interview.practice

JavaScript Basics for Absolute Beginners interview questions

Answer aloud before opening each explanation. Focus on the reasoning, not memorized wording.

TypesScopeObjectsAsyncRuntimeFunctions

0/6 saved answers | 6 questions shown

01What is the difference between == and ===?TypesBeginner

Model answer

== performs coercion; === compares without coercing types.

Why

Strict equality is usually clearer because it avoids surprising conversion rules.

02What is a closure?ScopeBeginner

Model answer

A function together with access to the lexical environment where it was created.

Why

Closures power private state, callbacks, factories, and many asynchronous patterns.

03How does the prototype chain work?ObjectsIntermediate

Model answer

Property lookup continues through linked prototype objects until found or null.

Why

JavaScript inheritance is delegation through prototypes, even when class syntax is used.

04What does await do?AsyncIntermediate

Model answer

It pauses that async function until a promise settles without blocking the event loop.

Why

Other queued work can continue while the awaited operation is pending.

05What is the event loop?RuntimeAdvanced

Model answer

The scheduling mechanism that runs tasks and microtasks when the call stack is clear.

Why

Promise reactions use the microtask queue, which is processed before the next task.

06How does this get its value?FunctionsAdvanced

Model answer

Usually from the call site; arrow functions capture it lexically.

Why

Method calls, constructors, explicit binding, and plain calls establish different this values.

Back to track