Frontend fundamentals set

Eight questions on the JavaScript that frontend interviews actually test — closures, the event loop, this, equality and re-renders.

8 questions ~8 min No account needed
Answer what you can and skip what you cannot — an unanswered question is marked wrong, but guessing teaches you nothing. Marking happens when you submit; nothing is stored against you.
Question 1 of 8 Closures

What does this log? function c() { let n = 0; return () => ++n; } const a = c(), b = c(); console.log(a(), a(), b());

Question 2 of 8 Event loop

What is the output order? console.log("A"); setTimeout(() => console.log("B"), 0); Promise.resolve().then(() => console.log("C")); console.log("D");

Question 3 of 8 this

Why does an arrow function used as an object method not get the object as `this`?

Question 4 of 8 Equality

Which comparison is TRUE?

Question 5 of 8 Immutability

State holds an array. You call items.push(x) then setItems(items) and the UI does not update. Why?

Question 6 of 8 Re-renders

Which of these does NOT by itself cause a component to re-render?

Question 7 of 8 Async

A fetch fails because the user is offline. What is the minimum acceptable behaviour?

Question 8 of 8 Review

A reviewer has ninety seconds and forty portfolio links. What do they open first?

0 of 8 answered