export function division() {
let numberOne = +prompt("Введите первое число");
let numberTwo = +prompt("Введите номер два");
let one = BigInt(numberOne);
let two = BigInt(numberTwo);
let result = (one / two);
alert(result);
}
import { division } from './main.js';
division();
<?php
$args = array(
'post_type' => 'tour',
'tax_query' => array(
array(
'taxonomy' => 'tours',
'field' => 'term_id',
'terms' => 78
)
)
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
?>
<div class="wrapper-col3">
<div class="news-col">
<a href="<?php the_permalink(); ?>" class="block-news uk-cover-container"><img src="<?php the_post_thumbnail_url('slider'); ?>" loading="lazy" alt="image" uk-cover></a>
<a href="<?php the_permalink(); ?>" class="block-news_title font-style-NotoSerif font-style-h3"><?php the_title(); ?></a>
<div class="block-news_text font-style-grey"><?php the_excerpt(); ?></div>
</div>
</div>
<?php
}
wp_reset_postdata();
} else {
echo 'No posts found';
}
?>
if ( $product->is_type( 'variable' ) ) {
$available_variations = $product->get_available_variations();
foreach ( $available_variations as $variation ) {
// получаем обычную цену вариации
$regular_price = $variation['display_regular_price'];
// получаем цену со скидкой вариации, если она есть
$sale_price = $variation['display_price'];
if ( $regular_price !== $sale_price ) {
echo 'Sale price: ' . $sale_price;
} else {
echo 'Regular price: ' . $regular_price;
}
}
} else {
// это не вариативный товар, выводим обычную и скидочную цены
$regular_price = $product->get_regular_price();
$sale_price = $product->get_sale_price();
if ( $regular_price !== $sale_price ) {
echo 'Sale price: ' . $sale_price;
} else {
echo 'Regular price: ' . $regular_price;
}
}
window.onload = function () {
let cube = document.getElementById("cube");
let x = 0;
let y = 0;
let xr = 0;
let iX = setInterval(moveX, 5)
function moveX() {
if (x >= 200) {
clearInterval(iX);
let iY = setInterval(moveY, 5);
}
else {
x++;
xr++;
cube.style.left = x+"px";
}
};
function moveY() {
if (y >= 200) {
clearInterval(iY);
let iMINX = setInterval(moveMINX, 5);
}
else {
y++;
cube.style.top = y+"px";
}
};
function moveMINX() {
if (xr <= 0) {
clearInterval(iMINX)
}
else {
xr -= 1;
cube.style.left = xr + "px";
}
}
};
function increaseSalary() {
return api.getEmployees()
.then(emp => {
const [minSalaryEmployee] = emp.reduce(([minEmployee, minSalary], employee) => {
const { salary } = employee;
return salary < minSalary
? [employee, salary]
: [minEmployee, minSalary];
}, [null, Infinity]);
const { id, salary: oldSalary } = minSalaryEmployee;
const newSalary = oldSalary * 1.2;
return { id, salary: newSalary };
})
.then(({ id, salary }) => api.setEmployeeSalary(id, salary))
.then(({ name, id, salary }) => api.notifyEmployee(id, `Hello, ${name}! Congratulations, your new salary is ${salary}!`))
.catch(error => {
api.notifyAdmin(error);
return Promise.reject(error); // добавляем отклоненный промис
});
}
function increaseSalary() {
return api.getEmployees()
.then(emp => {
if (emp.length === 0) { // проверяем, что массив не пустой
throw new Error('No employees found');
}
const [minSalaryEmployee] = emp.reduce(([minEmployee, minSalary], employee) => {
const { salary } = employee;
return salary < minSalary
? [employee, salary]
: [minEmployee, minSalary];
}, [null, Infinity]);
const { id, salary: oldSalary } = minSalaryEmployee;
const newSalary = oldSalary * 1.2;
return { id, salary: newSalary };
})
.then(({ id, salary }) => api.setEmployeeSalary(id, salary))
.then(({ name, id, salary }) => api.notifyEmployee(id, `Hello, ${name}! Congratulations, your new salary is ${salary}!`))
.catch(error => {
api.notifyAdmin(error);
return Promise.reject(error);
});
}