Core concepts, definitions, basic syntax, and first principles expected in round 1 screening.
undefined, null, boolean, number, string, symbol, and bigint. Stored directly in the stack memory. They are immutable and compared by value.typeof "hello" === "string"), but returns "object" for null, arrays, and plain objects.arr instanceof Array === true). Only works for objects/reference types.var, let, or const). Accessible only within that function.{} using let or const. They cannot be accessed outside that block. var does not respect block scope.undefined. Accessible before declaration.ReferenceError.let or const variable throws a ReferenceError.| Feature | var |
let |
const |
|---|---|---|---|
| Scope | Function scope | Block scope | Block scope |
| Hoisting | Yes (initialized as undefined) |
Yes (uninitialized, TDZ active) | Yes (uninitialized, TDZ active) |
| Re-assignment | Allowed | Allowed | Not Allowed |
| Redeclaration | Allowed within same scope | Not Allowed | Not Allowed |
function createCounter() {
let count = 0;
return () => ++count;
}
const counter = createCounter();
console.log(counter()); // 1
console.log(counter()); // 2
You've completed the 5 free sample questions. Get unrestricted lifetime access to every question, model answer, implementation challenge, and all 27+ technologies for a single payment.
₹399 India / $9 International · One-time settlement · Zero subscription