JavaScript
Scope, hoisting, closures, the event loop, and the async model — the fundamentals that show up in almost every frontend interview.
var, let, and const
Beginnerlet and const are block-scoped and fail loudly when misused, while var is function-scoped and fails silently. Covers scope, hoisting, the temporal dead zone, and why const does not mean immutable.
Primitive vs Reference Types
BeginnerPrimitives hold a value directly, while objects and arrays hold a reference to one. That single difference explains how copying, comparing, and passing them into functions behave.
Array Methods and Immutable Updates
BeginnerSome array methods change the original array and some return a new one, and mixing them up is the most common cause of state that silently fails to update. Covers which is which, the four update patterns, and the shallow copy trap.
Closures Explained
IntermediateA closure is a function that keeps access to the variables of the scope it was created in, even after that scope has finished running. It is what makes private state, factory functions, and most callback patterns possible.
The Event Loop and Microtasks
IntermediateJavaScript runs one thing at a time, and the event loop decides what runs next. Microtasks such as promise callbacks always jump ahead of timers and events, which explains most surprising ordering in async code.
Promises and async/await
IntermediateA promise is a placeholder for a value that isn't ready yet, and async/await is a flatter syntax for the same machinery. Covers the three states, chaining, error handling, and running work in parallel instead of one at a time.
`this` and Binding Rules
IntermediateThe value of `this` is decided by how a function is called, not by where it was written. Covers the four binding rules and their priority, why extracting a method loses its this, and how arrow functions opt out entirely.