function foo(num) {
return new Promise((resolve) => console.log(num));
}
foo(1).then(() => {
foo(3);
});
The function foo returns an immediately resolve promise. “1” is printed, but why doesn’t the chain continue with printing “3”?
1
function foo(num) {
return new Promise((resolve) => console.log(num));
}
foo(1).then(() => {
foo(3);
});
The function foo returns an immediately resolve promise. “1” is printed, but why doesn’t the chain continue with printing “3”?
1