Get crystal-clear on the JS fundamentals they will test.
Closures, Scope, Hoisting
function counter() {
let count = 0;
return () => ++count;
}
const inc = counter();
console.log(inc()); // 1
console.log(inc()); // 2
→ Be ready to explain how closures preserve state.
Event Loop / Async JS
console.log("A");
setTimeout(()=>console.log("B"),0);
Promise.resolve().then(()=>console.log("C"));
console.log("D");
// Output: A D C B
→ Practice explaining why (micro vs macro tasks).
Array/Object Mastery
Debounce & Throttle
Understand their purpose and how to implement them.
Show mastery of React fundamentals + component logic.
useState / useEffect
const [count, setCount] = useState(0);
useEffect(() => {
console.log("Count changed:", count);
return () => console.log("Cleanup"); // unmount
}, [count]);
useCallback / useMemo
Controlled Components
<input value={name} onChange={e => setName(e.target.value)} />
Conditional Rendering
{isLoading ? <Spinner /> : <DataList />}