const getFn = async () => {
let loading = true;
try {
// Некий проммис
} catch (e) {
// Обработка ошибки
} finaly {
loading = false;
}
}
async function probSetter(order_id) {
return await axios.get(`http://site.local/calc-probs?order_id=${order_id}`)
}
const arr = [1, 2]
const promises = arr.map(n => proprobSetter(n))
Promise.all(promises).then(results => {
results.forEach((n, i) => {
console.log(`${i} = ${n}`)
});
})
let arr = [2, 55, 6, 65, 65, 65, 65, 65, 6, 4, 84, 5];
let result = 'Нет';
for(let i = 0; i < arr.length; i++){
if (arr[i] == 5) result = 'Есть';
}
document.write(result);
let arr = [2, 55, 6, 65, 65, 65, 65, 65, 6, 4, 84, 5];
const result = arr.some(n => n === 5);
document.body.textContent = result ? 'Есть' : 'Нет';
.popup {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1000;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
$('.popup').fadeOut();