Do you know what will be the output of this code?
JavaScript
Promise.resolve(1)
.then((x) => x + 1)
.then((x) => {
x * 2;
})
.then((x) => console.log(x));
Show answer and explanation
The answer is undefined.
The second callback uses braces, so it needs an explicit return. Without one it returns undefined, and that’s what the next .then receives.