What will be the output of the following code?
const promise = new Promise((resolve, reject) => {
resolve(42);
});
promise.then((result) => {
console.log(result);
return result * 2;
}).then((result) => {
console.log(result);
});
What will be the output of the following code?
const promise = new Promise((resolve, reject) => {
resolve(42);
});
promise.then((result) => {
console.log(result);
return result * 2;
}).then((result) => {
console.log(result);
});