← Quiz: Async JavaScript: all 10 questions
Quiz: Async JavaScript · Question 5 of 10
What does this print? (code)
What does this print?
async function f() { return 5; }
f().then((v) => console.log(v + 1));
- A.5
- B.6
- C.[object Promise]1
- D.undefined
Answer & explanation
Correct answer: 6
f() returns a promise of 5; .then receives 5 and prints 6.
Can you get the rest right without peeking?
Take the timed Quiz: Async JavaScript quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →