Do you know what will be the output of this code?
JavaScript
async function f() {
return 1;
}
console.log(f() instanceof Promise);
Show answer and explanation
The answer is true.
async functions always return a promise. return 1 becomes Promise.resolve(1), so you need await f() or .then() to get the 1.