Do you know what will be the output of this code?
JavaScript
new Promise((resolve) => {
resolve("first");
resolve("second");
}).then(console.log);
Show answer and explanation
The answer is "first".
Once a promise is fulfilled or rejected, its state is locked. The second resolve call does nothing and throws no error.