I know the output of the code but can anyone please tell me when setTimeout will be called please...
function delay(time) {
return new Promise(function (resolve) {
setTimeout(() => {
resolve();
}, time);
})
}
delay(3000).then(function () {
console.log("run after 3000 seconds")
})