What will be the output of the following code?
const promise = new Promise((resolve, reject) => {
setTimeout(() => {
resolve('Success!');
}, 2000);
});
promise.then((result) => {
console.log(result);
});
What will be the output of the following code?
const promise = new Promise((resolve, reject) => {
setTimeout(() => {
resolve('Success!');
}, 2000);
});
promise.then((result) => {
console.log(result);
});