JavaScript Advanced Test

Challenge your understanding of promises, object behavior, async functions and modern operators.

6 questions. Choose the best answer for each question, then review every explanation.

Question 1 of 6

1 of 6
Question 1Which value is logged first after "start"?
console.log('start');
setTimeout(() => console.log('timeout'), 0);
Promise.resolve().then(() => console.log('promise'));
Question 2What kind of copy does object spread create?
const copy = { ...original };
Question 3What does optional chaining return when the value before ?. is null or undefined?
profile.address?.city
Question 4When does the nullish coalescing operator use its right-hand value?
value ?? fallback
Question 5What does an async function always return?
Question 6Which statement about Object.freeze() is correct?