in this code gets executed syncronously?
function codeBlocker() {
return new Promise((resolve, reject) => {
let i = 0;
while (i < 100000) {
i++;
}
resolve("loop done")
})
}
codeBlocker().then(result => console.log(result));
isn't the creation of a promise supposed to be async?
The function in the promise starts executing immediately
Обсуждают сегодня