JavaScript
From types and closures to async, DOM, and machine-coding classics. · 135 Q&A · click a card to expand
JavaScript Basics & History
7 items01Who created JavaScript and why was it built?Must know
Brendan Eich created JavaScript in 10 days at Netscape (1995) to add scripting to web pages in the browser.
Brendan Eich created JavaScript in 10 days at Netscape (1995) to add scripting to web pages in the browser. It was originally called Mocha, then LiveScript, then JavaScript — a marketing name tied to Java's popularity, though the languages are unrelated.
Follow-up: ECMAScript is the official specification; JavaScript is an implementation of it.
02What is the difference between JavaScript and ECMAScript?
ECMAScript (ES) is the language specification maintained by TC39.
ECMAScript (ES) is the language specification maintained by TC39. JavaScript is a concrete implementation of that spec (V8, SpiderMonkey, JavaScriptCore). When people say "ES6 features," they mean features standardized in ECMAScript 2015.
03What are the main ways to include JavaScript in an HTML page?
Inline
<script> tags, external .js files via <script src="...">, and module scripts via <script type="module">.Inline
<script> tags, external .js files via <script src="...">, and module scripts via <script type="module">. Modules are deferred by default and run in strict mode with their own scope.Common mistake: Placing blocking scripts in
<head> without defer/async, which delays page rendering.04What is strict mode and what does 'use strict' change?
Strict mode opts into a restricted variant of JavaScript that catches silent errors and disables unsafe features.
Strict mode opts into a restricted variant of JavaScript that catches silent errors and disables unsafe features. It forbids implicit globals, duplicate parameter names, and octal literals;
this in plain functions becomes undefined instead of the global object.javascript
'use strict';
x = 10; // ReferenceError — x was never declared05What is the difference between var, let, and const?Must know
var is function-scoped and hoisted (initialized as undefined).var is function-scoped and hoisted (initialized as undefined). let and const are block-scoped and live in the temporal dead zone until their declaration line runs. const requires initialization and prevents reassignment of the binding (not deep immutability of objects).06What is the temporal dead zone (TDZ)?
The period from the start of a block until a
let/const declaration is evaluated, during which accessing the variable throws a ReferenceError.The period from the start of a block until a
let/const declaration is evaluated, during which accessing the variable throws a ReferenceError. Hoisting still occurs, but without initialization.07How does JavaScript compare to other languages in typing?
JavaScript is dynamically typed — variable types are determined at runtime.
JavaScript is dynamically typed — variable types are determined at runtime. It is also weakly typed in that implicit coercion can happen during operations (
"5" + 1 → "51").Engine, Runtime & Execution
6 items08What is the JavaScript engine vs the runtime environment?Must know
The engine (V8, SpiderMonkey) parses, compiles, and executes JS.
The engine (V8, SpiderMonkey) parses, compiles, and executes JS. The runtime adds APIs beyond the language spec: in browsers that's the DOM,
fetch, timers; in Node.js it's fs, process, etc. Your code runs on engine + host APIs together.Follow-up: V8 uses Ignition (interpreter) + TurboFan (optimizing compiler) in modern versions.
09What happens when JavaScript code runs — parse, compile, execute?
Source is parsed into an AST, then compiled (JIT: often bytecode first, hot paths optimized later), then executed on the call stack.
Source is parsed into an AST, then compiled (JIT: often bytecode first, hot paths optimized later), then executed on the call stack. Identifiers are resolved via scope chains; objects live on the heap.
10What is JIT compilation?
Just-In-Time compilation means the engine interprets code first for fast startup, then profiles hot functions and recompiles them to optimized machine code.
Just-In-Time compilation means the engine interprets code first for fast startup, then profiles hot functions and recompiles them to optimized machine code. Deoptimization occurs if assumptions break (e.g., type changes).
11What is the call stack?
A LIFO structure tracking active function executions.
A LIFO structure tracking active function executions. Each function call pushes a stack frame; returning pops it. Stack overflow happens when recursion or deep calls exceed the limit.
12What is the heap in JavaScript?
Memory region where objects, closures, and arrays are stored.
Memory region where objects, closures, and arrays are stored. References (variables) on the stack point to heap allocations. Garbage collection reclaims unreachable heap objects.
13How does garbage collection work at a high level?
Modern engines use generational GC: young objects are scanned frequently (minor GC); long-lived objects are promoted and collected less often (major GC).
Modern engines use generational GC: young objects are scanned frequently (minor GC); long-lived objects are promoted and collected less often (major GC). Reachability is typically determined from roots (globals, stack references).
Common mistake: Assuming "delete obj.prop" frees memory immediately — only unreachability triggers GC.
Types, Variables & Equality
7 items14What are JavaScript's primitive types?Must know
Seven primitives:
string, number, bigint, boolean, undefined, symbol, and null.Seven primitives:
string, number, bigint, boolean, undefined, symbol, and null. Everything else is an object (including arrays, functions, dates).javascript
typeof null; // "object" — historical bug
typeof Symbol(); // "symbol"15What is the difference between == and ===?Must know
=== is strict equality — no coercion; types must match.=== is strict equality — no coercion; types must match. == performs abstract equality with coercion rules (null == undefined is true; 0 == false is true). Prefer === unless you explicitly need coercion.16How does Object.is() differ from ===?
Object.is(NaN, NaN) is true; NaN === NaN is false.Object.is(NaN, NaN) is true; NaN === NaN is false. Object.is(+0, -0) is false; +0 === -0 is true. Useful for edge cases in libraries and React's state comparison logic.17What is undefined vs null?
undefined means a variable was declared but not assigned, or a missing property/parameter.undefined means a variable was declared but not assigned, or a missing property/parameter. null is an intentional absence-of-value assignment. Both are falsy, but typeof undefined is "undefined" and typeof null is "object".18What are Symbols used for?
Symbols are unique, immutable primitive identifiers.
Symbols are unique, immutable primitive identifiers. Common uses: non-enumerable object keys, well-known symbols (
Symbol.iterator), and avoiding property name collisions in meta-programming.19What is the difference between pass-by-value and pass-by-reference in JS?
Primitives are passed by value (copied).
Primitives are passed by value (copied). Objects are passed by reference value — the reference is copied, so mutating the object inside a function affects the original. Reassigning the parameter does not change the caller's variable.
20How do you check if a value is an array?
Array.isArray(value) is the reliable method.Array.isArray(value) is the reliable method. typeof [] returns "object", and instanceof Array can fail across realms/iframes.Type Coercion
7 items21What is implicit vs explicit coercion?
Explicit:
Number("42"), String(42), Boolean(0).Explicit:
Number("42"), String(42), Boolean(0). Implicit: happens in ==, + with strings, if (value), template literals. Understanding coercion prevents subtle bugs in comparisons and arithmetic.22What does "5" + 3 vs "5" - 3 produce and why?
"5" + 3 → "53" because + prefers string concatenation if either operand is a string."5" + 3 → "53" because + prefers string concatenation if either operand is a string. "5" - 3 → 2 because - only works with numbers, so "5" is coerced to 5.23What is truthy and falsy in JavaScript?Must know
Falsy values:
false, 0, -0, 0n, "", null, undefined, NaN.Falsy values:
false, 0, -0, 0n, "", null, undefined, NaN. Everything else is truthy — including [], {}, and "0".Common mistake: Assuming empty arrays/objects are falsy.
24What happens with [] + [] and [] + {}?
Both operands are coerced via
ToPrimitive.Both operands are coerced via
ToPrimitive. Arrays become empty strings: [] + [] → "". {} becomes "[object Object]", so [] + {} → "[object Object]".25How does coercion work in the == algorithm (simplified)?
If types differ, convert to numbers (except
null/undefined pair).If types differ, convert to numbers (except
null/undefined pair). Objects become primitives via valueOf/toString. Then compare numerically or by reference for objects.26What is ?? (nullish coalescing)?
Returns the right side only when the left is
null or undefined — not for other falsy values.Returns the right side only when the left is
null or undefined — not for other falsy values. 0 ?? 5 is 0; null ?? 5 is 5. Often paired with optional chaining.27What is optional chaining (?.)?
Short-circuits to
undefined if the base is null or undefined instead of throwing.Short-circuits to
undefined if the base is null or undefined instead of throwing. Works for properties, calls, and brackets: user?.address?.zip, callback?.().Functions
8 items28What are the ways to define a function in JavaScript?
Function declaration (
function foo() {}), function expression (const foo = function() {}), arrow function (const foo = () => {}), method shorthand in...Function declaration (
function foo() {}), function expression (const foo = function() {}), arrow function (const foo = () => {}), method shorthand in objects, and Function constructor (rarely used).29What is the difference between function declarations and expressions?
Declarations are fully hoisted (name and body).
Declarations are fully hoisted (name and body). Named function expressions hoist the name only inside the function body (in modern engines). Anonymous expressions assign to variables subject to
let/const TDZ rules.30What is an arrow function and how does it differ from regular functions?Must know
Arrow functions have lexical
this, no arguments object, cannot be used as constructors (new), and have concise syntax.Arrow functions have lexical
this, no arguments object, cannot be used as constructors (new), and have concise syntax. Ideal for callbacks; avoid when you need dynamic this or arguments.javascript
const obj = {
id: 1,
regular() { console.log(this.id); },
arrow: () => console.log(this.id) // lexical this — often wrong in methods
};31What is an IIFE and why use one?
Immediately Invoked Function Expression — `(function () { ...
Immediately Invoked Function Expression —
(function () { ... })(); — creates a private scope, avoiding global pollution. Less common now with modules and block scope.32What are default parameters?
ES6 allows
function greet(name = 'Guest').ES6 allows
function greet(name = 'Guest'). Defaults apply when the argument is undefined (not when it is null). Later defaults can reference earlier parameters.33What is rest vs spread syntax?
Rest collects remaining arguments:
function sum(...nums).Rest collects remaining arguments:
function sum(...nums). Spread expands iterables: [...arr1, ...arr2], { ...obj, key: val }. Both use ... but in opposite directions.34What is a higher-order function?
A function that takes another function as an argument or returns a function.
A function that takes another function as an argument or returns a function. Examples:
map, filter, reduce, middleware in Express-style patterns, and custom decorators.35What is currying?
Transforming a multi-argument function into a chain of single-argument functions:
const add = a => b => a + b.Transforming a multi-argument function into a chain of single-argument functions:
const add = a => b => a + b. Useful for partial application and reusable configuration.Scope, Closures & Hoisting
8 items36What is lexical scope?
Scope is determined by where functions and blocks are written, not where they are called.
Scope is determined by where functions and blocks are written, not where they are called. Inner functions can access outer variables; the lookup walks the scope chain outward.
37What is a closure?Infosys
A closure is when a function retains access to variables from its outer lexical scope even after that outer function has finished executing.
A closure is when a function retains access to variables from its outer lexical scope even after that outer function has finished executing. The inner function "closes over" those bindings.
javascript
function makeCounter() {
let count = 0;
return () => ++count;
}
const counter = makeCounter();
counter(); // 1
counter(); // 2Follow-up: Closures power data privacy, factories, and memoization.
Common mistake: Creating closures in a loop with
var — all callbacks share one i. Fix with let or IIFE.38Explain the classic loop + setTimeout closure problem.
With
var, one shared i exists; after the loop, i === 3.With
var, one shared i exists; after the loop, i === 3. All timeouts log 3. Fix: use let (block-scoped per iteration), pass i as a parameter, or use forEach with a closure.javascript
for (let i = 0; i < 3; i++) {
setTimeout(() => console.log(i), 0); // 0, 1, 2
}39What is hoisting?Must know
Declarations are processed before execution.
Declarations are processed before execution.
var and function declarations hoist to the top of their scope (var initialized as undefined). let/const hoist but stay in TDZ until their line runs.40What gets hoisted — variables vs functions?
Function declarations hoist with their full body.
Function declarations hoist with their full body.
var hoists declaration only. let/const hoist but throw if accessed early. Function expressions follow variable hoisting rules of their binding.41Can you give a practical use case for closures in interviews?Infosys
Module pattern, debounce/throttle implementations, React hooks (state captured per render), event handler factories, and caching/memoization where a private...
Module pattern, debounce/throttle implementations, React hooks (state captured per render), event handler factories, and caching/memoization where a private cache lives in the closure.
42What is block scope vs function scope?
let/const/class are block-scoped ({}, if, loops).let/const/class are block-scoped ({}, if, loops). var is function-scoped (or global). Blocks with let do not leak to outer scopes.43What happens with nested closures and memory?
Outer variables referenced by inner functions stay alive on the heap.
Outer variables referenced by inner functions stay alive on the heap. Unused closures can cause memory leaks if DOM nodes or large objects are retained — detach listeners and null references when done.
Arrays & Objects
8 items44How do you shallow copy vs deep copy an object?Must know
Shallow:
{ ...obj }, Object.assign({}, obj), [...arr].Shallow:
{ ...obj }, Object.assign({}, obj), [...arr]. Deep: structuredClone(obj) (modern), JSON.parse(JSON.stringify(obj) (limited — no functions, dates, undefined), or libraries like lodash cloneDeep.45What is the difference between map, filter, and reduce?
map transforms each element to a new array.map transforms each element to a new array. filter keeps elements matching a predicate. reduce accumulates to a single value (or object/array) using a reducer function.46What are Object.keys, values, and entries?
They return arrays of own enumerable string-keyed properties: keys, values, or
[key, value] pairs.They return arrays of own enumerable string-keyed properties: keys, values, or
[key, value] pairs. They ignore symbol keys unless combined with Object.getOwnPropertySymbols.47How does property lookup work on objects?
Engine checks the object itself, then walks the prototype chain until it finds the property or reaches
null.Engine checks the object itself, then walks the prototype chain until it finds the property or reaches
null. Assignments on own properties do not traverse the chain unless the property is an accessor on the prototype.48What is Object.freeze vs Object.seal?
freeze prevents adding, deleting, and modifying properties.freeze prevents adding, deleting, and modifying properties. seal prevents adding/deleting but allows modifying existing values. Both are shallow — nested objects can still mutate.49How do you safely check own properties?
Object.hasOwn(obj, 'key') (ES2022) or Object.prototype.hasOwnProperty.call(obj, 'key') to avoid issues with null prototype or overridden hasOwnProperty.50What is destructuring assignment?
Unpack values from arrays or properties from objects into variables:
const { a, b = 1 } = obj; const [first, ...rest] = arr;.Unpack values from arrays or properties from objects into variables:
const { a, b = 1 } = obj; const [first, ...rest] = arr;. Supports renaming, defaults, and nested patterns.51What is the spread operator with objects — merge gotchas?
Later keys overwrite earlier ones:
{ ...a, ...b }.Later keys overwrite earlier ones:
{ ...a, ...b }. Only enumerable own properties copy. For deep merge, implement recursion or use a utility.ES6 Collections (Map, Set, WeakMap, WeakSet)
5 items52When should you use a Map instead of a plain object?
When keys are non-strings (objects, functions), you need guaranteed insertion order with frequent add/delete, or you want
.size without counting keys.When keys are non-strings (objects, functions), you need guaranteed insertion order with frequent add/delete, or you want
.size without counting keys. Objects are fine for static string-keyed records.53What is a Set and common use cases?
A collection of unique values (by
SameValueZero equality).A collection of unique values (by
SameValueZero equality). Use for deduplication: [...new Set(arr)], tracking visited nodes in graphs, or membership tests with O(1) average lookup.54What are WeakMap and WeakSet?
Keys must be objects; references are weak — if no other references exist, entries can be GC'd.
Keys must be objects; references are weak — if no other references exist, entries can be GC'd. Useful for private metadata on DOM nodes or caches that should not prevent collection. Not iterable; no
.size.55Can you use objects as Map keys?
Yes.
Yes. Maps compare keys by reference, not by value. Two
{ id: 1 } objects are different keys unless they are the same reference.56What is the iteration order for Map vs Object?
Map preserves insertion order for all keys.
Map preserves insertion order for all keys. Ordinary objects preserve insertion order for string keys (ES2015+) but have legacy quirks with integer-like keys sorting first.
DOM Manipulation
6 items57What is the DOM?
The Document Object Model is the browser's tree representation of HTML.
The Document Object Model is the browser's tree representation of HTML. JavaScript can query, create, modify, and remove nodes. Each node is an object with properties and methods (
querySelector, appendChild, etc.).58What is the difference between getElementById, querySelector, and querySelectorAll?
getElementById returns one element by id.getElementById returns one element by id. querySelector returns the first match for any CSS selector. querySelectorAll returns a static NodeList of all matches.59What is reflow vs repaint?
Reflow (layout) recalculates geometry when size/position changes — expensive.
Reflow (layout) recalculates geometry when size/position changes — expensive. Repaint redraws pixels (color, visibility) without layout change. Batch DOM reads/writes; use
documentFragment or virtual DOM patterns to minimize reflows.60What is event delegation at the DOM level?
Attach one listener on a parent; use
event.target to handle events from children.Attach one listener on a parent; use
event.target to handle events from children. Reduces listener count and works for dynamically added elements. Covered in detail in the Events section.61What is innerHTML vs textContent vs innerText?
innerHTML parses HTML (XSS risk with user input).innerHTML parses HTML (XSS risk with user input). textContent gets/sets raw text including hidden nodes. innerText respects CSS visibility and layout, triggering reflow — slower.Common mistake: Injecting unsanitized user HTML into
innerHTML.62What is a DocumentFragment?
A lightweight container for batching DOM inserts.
A lightweight container for batching DOM inserts. Append children to the fragment, then append the fragment once — triggers a single reflow instead of many.
Events — Bubbling, Capture & Delegation
7 items63What are the three phases of event propagation?Infosys
(1) Capture — from window down to target.
(1) Capture — from window down to target. (2) Target — listeners on the target element. (3) Bubble — from target back up to window. Most handlers run in bubble phase by default.
javascript
element.addEventListener('click', handler, true); // capture
element.addEventListener('click', handler, false); // bubble (default)64What does event.stopPropagation() do?
Prevents the event from traveling to other elements in the current phase chain.
Prevents the event from traveling to other elements in the current phase chain. It does not stop other listeners on the same element unless you also use
stopImmediatePropagation().65What is event.preventDefault()?
Cancels the browser's default action (form submit, link navigation) if the event is cancelable.
Cancels the browser's default action (form submit, link navigation) if the event is cancelable. Does not stop propagation.
66Explain event delegation and why it is useful.Infosys
Register a single listener on a common ancestor; identify the actual source via
event.target (often with closest() for nested markup).Register a single listener on a common ancestor; identify the actual source via
event.target (often with closest() for nested markup). Benefits: fewer listeners, automatic support for dynamic children, simpler cleanup.javascript
document.getElementById('list').addEventListener('click', (e) => {
const item = e.target.closest('li[data-id]');
if (!item) return;
console.log(item.dataset.id);
});67What is the difference between event.target and event.currentTarget?
target is the element that triggered the event (deepest clicked node).target is the element that triggered the event (deepest clicked node). currentTarget is the element whose listener is currently running (often the delegated parent).68What are custom events?
new CustomEvent('my-event', { detail: { id: 1 }, bubbles: true }) plus element.dispatchEvent(evt).new CustomEvent('my-event', { detail: { id: 1 }, bubbles: true }) plus element.dispatchEvent(evt). Useful for decoupled component communication in vanilla JS or web components.69What is passive event listening?
{ passive: true } tells the browser the listener will not call preventDefault(), enabling scroll optimizations.{ passive: true } tells the browser the listener will not call preventDefault(), enabling scroll optimizations. Touch/wheel listeners may be passive by default in modern browsers.Event Loop, Microtasks & Macrotasks
7 items70What is the event loop?Must know
JavaScript is single-threaded.
JavaScript is single-threaded. The event loop continuously: (1) runs synchronous code on the call stack, (2) drains the microtask queue (promises,
queueMicrotask), (3) takes one macrotask (timer, I/O callback), repeat. This interleaves async work without parallel threads in JS itself.71What is the output order of this code?Must know
1, 4, 3, 2.1, 4, 3, 2. Sync first; microtasks (promise) before the next macrotask (timeout).72What is the difference between microtasks and macrotasks?
Microtasks: promise callbacks,
queueMicrotask, MutationObserver.Microtasks: promise callbacks,
queueMicrotask, MutationObserver. Macrotasks: setTimeout, setInterval, I/O, UI rendering. After each macrotask, all pending microtasks run to completion.73Can microtasks starve the UI?
Yes.
Yes. An infinite chain of
Promise.resolve().then(...) keeps draining microtasks without yielding to rendering or macrotasks. Always break long async work into chunks or use requestAnimationFrame/setTimeout for breathing room.74What is queueMicrotask used for?
Schedules a callback in the microtask queue — same priority as promise
.then.Schedules a callback in the microtask queue — same priority as promise
.then. Useful for running code after the current task but before the next macrotask, e.g., flushing internal queues.75How does setTimeout(fn, 0) behave?
Schedules
fn as a macrotask after current sync code and all microtasks complete.Schedules
fn as a macrotask after current sync code and all microtasks complete. Minimum delay is often ~4ms in browsers (HTML spec clamping), not literally zero.76What is batching of async updates similar to React setState?Infosys
React 18 batches multiple state updates in event handlers and many async contexts into one re-render.
React 18 batches multiple state updates in event handlers and many async contexts into one re-render. In plain JS, you can batch DOM and logic updates by deferring work to a microtask or
requestAnimationFrame so multiple synchronous mutations coalesce before a single paint. The pattern below mirrors how React schedules a flush after several rapid updates — useful when building vanilla widgets or design systems outside React.javascript
let pending = false;
let state = { count: 0 };
function scheduleUpdate() {
if (pending) return;
pending = true;
queueMicrotask(() => {
pending = false;
render(state); // single paint after multiple increments
});
}
function increment() {
state = { ...state, count: state.count + 1 };
scheduleUpdate();
}Follow-up:
Promise.resolve().then(flush) achieves similar microtask batching; requestAnimationFrame batches to the next frame for visual updates.Promises & Async/Await
8 items77What is a Promise and its three states?Must know
A Promise represents a future value.
A Promise represents a future value. States: pending, fulfilled (with a value), rejected (with a reason). Settled means fulfilled or rejected; state is immutable once settled.
78What is the difference between .then() chaining and async/await?
Both compile to promise handling.
Both compile to promise handling.
async/await reads synchronously and uses try/catch for errors. Chaining uses return values and .catch(). async functions always return a Promise.79How do you handle errors in async/await?
Wrap in
try/catch around await, or let the returned promise reject and attach .catch() at the call site.Wrap in
try/catch around await, or let the returned promise reject and attach .catch() at the call site. Unhandled rejections may log or crash in strict environments.80What is Promise.all vs Promise.allSettled vs Promise.race?
all rejects fast if any reject; resolves with array of results.all rejects fast if any reject; resolves with array of results. allSettled waits for all, never rejects — returns { status, value/reason }. race settles with the first settled promise.81What is promise chaining order?
Each
.then returns a new promise.Each
.then returns a new promise. Return values become fulfillment values; thrown errors or returned rejections propagate down the chain to the nearest .catch.82What is the async IIFE pattern?
(async () => { await doWork(); })(); — allows top-level await-like behavior in scripts without modules, or immediate async execution in callbacks.83Can you await non-promise values?
Yes.
Yes.
await 42 wraps the value in Promise.resolve(42). Useful but often unnecessary in mixed code.84What is a common async anti-pattern?
Sequential awaits in a loop when work is independent — use
Promise.all(items.map(async item => ...)) for parallelism.Sequential awaits in a loop when work is independent — use
Promise.all(items.map(async item => ...)) for parallelism. Also: forgetting to return a promise inside .then, breaking the chain.`this`, call, apply & bind
5 items85How is this determined in JavaScript?Must know
this is set at call time, not definition time (except arrows, which use lexical this):.- Default binding — non-strict: global; strict:
undefined - Implicit —
obj.method()→obj - Explicit —
call/apply/bind new— new empty object- Arrow — lexical from enclosing scope
86What is the difference between call, apply, and bind?Must know
call(fn, arg1, arg2) invokes immediately with comma-separated args.call(fn, arg1, arg2) invokes immediately with comma-separated args. apply takes an array of args. bind returns a new function with fixed this (and optional partial args) without invoking immediately.javascript
fn.call(ctx, 1, 2);
fn.apply(ctx, [1, 2]);
const bound = fn.bind(ctx, 1);87What happens to this in arrow functions used as object methods?
Arrow methods do not get their own
this; they inherit from the enclosing lexical scope — often the global object or outer function, not the object.Arrow methods do not get their own
this; they inherit from the enclosing lexical scope — often the global object or outer function, not the object. Use regular methods for object literals.88How does this work with event handlers?
DOM listeners called as
element.addEventListener('click', function() {}) set this to the element.DOM listeners called as
element.addEventListener('click', function() {}) set this to the element. Arrow handlers inherit lexical this from the surrounding scope (often not the element).89What is soft binding?
A pattern that tries explicit binding first but falls back to a default context if
undefined or null is passed — useful for APIs that should tolerate...A pattern that tries explicit binding first but falls back to a default context if
undefined or null is passed — useful for APIs that should tolerate loose calls.OOP & Prototypes
7 items90How does prototypal inheritance work?Must know
Every object has an internal
[[Prototype]] (accessed via Object.getPrototypeOf or __proto__).Every object has an internal
[[Prototype]] (accessed via Object.getPrototypeOf or __proto__). Property lookup walks the chain. Functions have a prototype property used when invoked with new — the new object's [[Prototype]] links to Constructor.prototype.javascript
function Person(name) { this.name = name; }
Person.prototype.greet = function () { return `Hi, ${this.name}`; };
const p = new Person('Alex');
p.greet(); // "Hi, Alex"91What does the new keyword do?
Creates a new object, sets its prototype to
Constructor.prototype, binds this to that object, executes the constructor, and returns the object (unless...Creates a new object, sets its prototype to
Constructor.prototype, binds this to that object, executes the constructor, and returns the object (unless constructor returns an object explicitly).92What is the difference between __proto__ and prototype?
prototype exists on functions — the object used as the prototype for instances.prototype exists on functions — the object used as the prototype for instances. __proto__ (legacy accessor) is on instances — points to their prototype object. Prefer Object.getPrototypeOf.93What are ES6 classes — syntactic sugar?
class provides cleaner syntax for constructor + prototype methods + extends/super.class provides cleaner syntax for constructor + prototype methods + extends/super. Under the hood, still prototype-based; hoisting differs from function declarations (TDZ applies).94What is method overriding vs shadowing?
Overriding replaces a method on a subclass prototype;
super.method() calls the parent.Overriding replaces a method on a subclass prototype;
super.method() calls the parent. Shadowing assigns an own property on an instance that hides a prototype property without changing the prototype chain.95What is instanceof checking?
Walks the prototype chain of
obj looking for Constructor.prototype.Walks the prototype chain of
obj looking for Constructor.prototype. Can be fooled by cross-realm objects or manual prototype manipulation.96How do you create objects without class?
Object literals,
Object.create(proto), factory functions, and constructor functions.Object literals,
Object.create(proto), factory functions, and constructor functions. Object.create(null) makes a dictionary without inherited pollution.Modules (ESM & CommonJS)
4 items97What is the difference between ES modules and CommonJS?
ESM (
import/export) is static, hoisted, supports tree-shaking, and runs in strict mode.ESM (
import/export) is static, hoisted, supports tree-shaking, and runs in strict mode. CommonJS (require/module.exports) is dynamic, synchronous, and dominant in older Node code. Node now supports both with "type": "module".98What is live binding in ES modules?
Imported bindings are live views of exported variables — if the exporter mutates
export let count = 0, importers see updates.Imported bindings are live views of exported variables — if the exporter mutates
export let count = 0, importers see updates. Unlike CommonJS, which copies the value at require time for primitives.99What is dynamic import()?
import('./module.js') returns a promise — enables code splitting and conditional loading.import('./module.js') returns a promise — enables code splitting and conditional loading. Supported in browsers and modern Node.100What is the module scope?
Each module has its own top-level scope — no globals unless explicitly attached to
window/globalThis.Each module has its own top-level scope — no globals unless explicitly attached to
window/globalThis. Top-level this is undefined in ES modules.Debounce, Throttle & Polyfills
6 items101What is debouncing?Infosys
Debouncing delays execution until after a burst of events stops for a specified wait time.
Debouncing delays execution until after a burst of events stops for a specified wait time. Classic use: search input — fire API call only after the user pauses typing, not on every keystroke.
javascript
function debounce(fn, wait, { leading = false, trailing = true } = {}) {
let timerId = null;
let lastArgs = null;
let lastThis = null;
function invoke() {
timerId = null;
if (trailing && lastArgs) fn.apply(lastThis, lastArgs);
lastArgs = lastThis = null;
}
function debounced(...args) {
lastArgs = args;
lastThis = this;
const isFirst = !timerId;
clearTimeout(timerId);
if (leading && isFirst) fn.apply(this, args);
timerId = setTimeout(invoke, wait);
}
debounced.cancel = () => {
clearTimeout(timerId);
timerId = lastArgs = lastThis = null;
};
debounced.flush = () => {
if (timerId) { clearTimeout(timerId); invoke(); }
};
return debounced;
}Follow-up: Leading-edge debounce fires immediately then suppresses until quiet period.
102What is throttling?Must know
Throttling ensures a function runs at most once per time window during continuous events (scroll, resize).
Throttling ensures a function runs at most once per time window during continuous events (scroll, resize). Unlike debounce, it guarantees periodic execution during activity.
javascript
function throttle(fn, wait) {
let last = 0;
let timerId = null;
let lastArgs = null;
let lastThis = null;
function trailingInvoke() {
last = Date.now();
timerId = null;
fn.apply(lastThis, lastArgs);
}
const throttled = function (...args) {
const now = Date.now();
const remaining = wait - (now - last);
lastArgs = args;
lastThis = this;
if (remaining <= 0 || remaining > wait) {
if (timerId) { clearTimeout(timerId); timerId = null; }
last = now;
fn.apply(this, args);
} else if (!timerId) {
timerId = setTimeout(trailingInvoke, remaining);
}
};
throttled.cancel = () => {
clearTimeout(timerId);
timerId = null;
lastArgs = lastThis = null;
};
return throttled;
}103When do you choose debounce vs throttle?Infosys
Debounce for end-of-action work (search, form validation after typing).
Debounce for end-of-action work (search, form validation after typing). Throttle for steady feedback during action (scroll position indicator, infinite scroll load, resize layout updates).
104Implement a debounce with cancel method.
```javascript function debounce(fn, wait) { let timerId; function debounced(...args) { clearTimeout(timerId); timerId = setTimeout(() => fn.apply(this,...
``
javascript function debounce(fn, wait) { let timerId; function debounced(...args) { clearTimeout(timerId); timerId = setTimeout(() => fn.apply(this, args), wait); } debounced.cancel = () => clearTimeout(timerId); return debounced; }. ``105What is a polyfill?
Code that implements a modern API on older environments, e.g.,
Array.prototype.includes shim.Code that implements a modern API on older environments, e.g.,
Array.prototype.includes shim. Feature detection (if (!Array.prototype.includes)) avoids overwriting native implementations.106Implement Array.prototype.map polyfill (simplified).
```javascript if (!Array.prototype.myMap) { Array.prototype.myMap = function (callback, thisArg) { if (this == null) throw new TypeError(); const arr =...
``
javascript if (!Array.prototype.myMap) { Array.prototype.myMap = function (callback, thisArg) { if (this == null) throw new TypeError(); const arr = Object(this); const len = arr.length >>> 0; const result = new Array(len); for (let i = 0; i < len; i++) { if (i in arr) result[i] = callback.call(thisArg, arr[i], i, arr); } return result; }; } ``Machine Coding & Practical Problems
14 items107Flatten a nested array to any depth.
```javascript function flatten(arr, depth = Infinity) { return depth === 0 ? arr.slice() : arr.reduce((acc, val) => { return acc.concat(Array.isArray(val) ?...
``
javascript function flatten(arr, depth = Infinity) { return depth === 0 ? arr.slice() : arr.reduce((acc, val) => { return acc.concat(Array.isArray(val) ? flatten(val, depth - 1) : val); }, []); } // Or: arr.flat(Infinity) natively. ``108Implement deepEqual for plain objects and arrays.
Compare types, handle null, recurse on keys for objects, index for arrays.
Compare types, handle null, recurse on keys for objects, index for arrays. Watch reference cycles with a
WeakMap in production versions.javascript
function deepEqual(a, b) {
if (a === b) return true;
if (typeof a !== 'object' || typeof b !== 'object' || !a || !b) return false;
const keysA = Object.keys(a);
const keysB = Object.keys(b);
if (keysA.length !== keysB.length) return false;
return keysA.every(k => deepEqual(a[k], b[k]));
}109Implement a function to reverse words in a string.
"hello world".split(' ').reverse().join(' ') → "world hello"."hello world".split(' ').reverse().join(' ') → "world hello". For in-place char reverse with word order: trim, split, reverse array, join — O(n) time, O(n) space.110Find the first non-repeating character in a string.
Two passes with a frequency map, or one pass with a Map preserving insertion order:.
javascript
function firstUnique(s) {
const freq = new Map();
for (const ch of s) freq.set(ch, (freq.get(ch) || 0) + 1);
for (const ch of s) if (freq.get(ch) === 1) return ch;
return null;
}111Implement memoization for a pure function.
```javascript function memoize(fn) { const cache = new Map(); return function (...args) { const key = JSON.stringify(args); if (cache.has(key)) return...
``
javascript function memoize(fn, { resolver = (...args) => JSON.stringify(args), maxSize = Infinity } = {}) { const cache = new Map(); function memoized(...args) { const key = resolver(...args); if (cache.has(key)) { const val = cache.get(key); cache.delete(key); cache.set(key, val); return val; } const result = fn.apply(this, args); cache.set(key, result); if (cache.size > maxSize) cache.delete(cache.keys().next().value); return result; } memoized.cache = cache; memoized.clear = () => cache.clear(); return memoized; }. ``Common mistake: Using JSON.stringify for keys when args include functions or circular structures.
112Implement a simple pub/sub (EventEmitter).
```javascript function createEmitter() { const events = new Map(); return { on(event, fn) { if (!events.has(event)) events.set(event, new Set());...
``
javascript function createEmitter() { const events = new Map(); return { on(event, fn) { if (!events.has(event)) events.set(event, new Set()); events.get(event).add(fn); return () => events.get(event).delete(fn); }, emit(event, payload) { events.get(event)?.forEach(fn => fn(payload)); } }; } ``113Implement Promise.all from scratch.
```javascript function promiseAll(iterable) { return new Promise((resolve, reject) => { const arr = Array.from(iterable); if (arr.length === 0) return...
``
javascript function promiseAll(iterable) { return new Promise((resolve, reject) => { const arr = Array.from(iterable); if (arr.length === 0) return resolve([]); const results = new Array(arr.length); let settled = 0; arr.forEach((p, i) => { Promise.resolve(p).then( val => { results[i] = val; if (++settled === arr.length) resolve(results); }, reject ); }); }); } ``114Implement LRU cache with Map.
Map preserves insertion order.
Map preserves insertion order. On get, delete and re-insert to mark recent. On set when over capacity, delete the first key (oldest).
javascript
class LRUCache {
constructor(limit) {
this.limit = limit;
this.map = new Map();
}
get(key) {
if (!this.map.has(key)) return undefined;
const val = this.map.get(key);
this.map.delete(key);
this.map.set(key, val);
return val;
}
set(key, val) {
if (this.map.has(key)) this.map.delete(key);
this.map.set(key, val);
if (this.map.size > this.limit) {
const oldest = this.map.keys().next().value;
this.map.delete(oldest);
}
}
}115Detect if two objects have deep cyclic reference equality safely.
Track visited pairs in a
WeakMap (object → object) during recursion.Track visited pairs in a
WeakMap (object → object) during recursion. If you revisit the same pair on both sides, treat as equal for that branch; if one side cycles and the other does not, return false.116Implement infinite curried sum: sum(1)(2)(3)() → 6.
```javascript function sum(a) { const fn = (b) => (b === undefined ? a : sum(a + b)); fn.valueOf = () => a; fn.toString = () => String(a); return fn; } //...
``
javascript function sum(a) { const fn = (b) => (b === undefined ? a : sum(a + b)); fn.valueOf = () => a; fn.toString = () => String(a); return fn; } // sum(1)(2)(3) + 0 or invoke with empty call if designed: sum(1)(2)(3)(). ``Follow-up: Interviewers may ask for empty final call
() returning the total — store accumulator in closure and return inner function until () with no args.117Group an array of objects by a key.
```javascript function groupBy(arr, key) { return arr.reduce((acc, item) => { const k = item[key]; (acc[k] ??= []).push(item); return acc; }, {}); }.
``
javascript function groupBy(arr, key) { return arr.reduce((acc, item) => { const k = item[key]; (acc[k] ??= []).push(item); return acc; }, {}); }. ``118Implement bind polyfill.
```javascript Function.prototype.myBind = function (ctx, ...boundArgs) { const fn = this; return function (...args) { return fn.apply(ctx, [...boundArgs,...
``
javascript Function.prototype.myBind = function (ctx, ...boundArgs) { const fn = this; return function (...args) { return fn.apply(ctx, [...boundArgs, ...args]); }; };. ``119Write a function to serialize and deserialize a binary tree (machine coding classic).
Use BFS or DFS with null markers.
Use BFS or DFS with null markers. JSON array form:
[1, 2, 3, null, null, 4, 5]. Deserialize with a queue indexing children positions 2i+1, 2i+2 for array heap layout, or recursive preorder with iterator.120Implement a rate-limited fetch queue (concurrency cap).
Maintain active count and a queue; when a task finishes, dequeue the next.
Maintain active count and a queue; when a task finishes, dequeue the next. Caps parallel network calls — common in Infosys-style practical rounds combining promises + data structures.
javascript
async function pooled(tasks, limit) {
const results = [];
let i = 0;
async function worker() {
while (i < tasks.length) {
const idx = i++;
results[idx] = await tasks[idx]();
}
}
await Promise.all(Array.from({ length: limit }, worker));
return results;
}Modern JavaScript Features
5 items122What are iterators and Symbol.iterator?
Arrays, strings, Maps, and Sets are iterable — work with for-of and spread.
Arrays, strings, Maps, and Sets are iterable — work with for-of and spread. Custom iterables implement
[Symbol.iterator]() returning iterator object. Generators automatically create iterators. Iterators enable lazy sequences — infinite lists without allocating full array. Interview tie-in: React keys and reconciliation don't use iterators, but data pipelines often do for large datasets.Follow-up: Iterable vs array-like?
``
javascript
const range = {
from: 1, to: 3,
[Symbol.iterator]() {
let cur = this.from;
const last = this.to;
return { next() { return cur <= last ? { value: cur++, done: false } : { done: true }; } };
}
};
``123What are generator functions?
Call returns iterator;
yield pauses and returns value; next() resumes.Call returns iterator;
yield pauses and returns value; next() resumes. Useful for lazy sequences, infinite streams, and coroutine-style async before async/await dominated. yield* delegates to another iterable. Generators power some Redux-Saga patterns. Rare in daily frontend now but appears in advanced JS interviews and polyfill implementations.Follow-up: Generators vs async functions?
124What is Proxy used for?
new Proxy(target, { get(obj, prop) {...}, set(obj, prop, val) {...} }).new Proxy(target, { get(obj, prop) {...}, set(obj, prop, val) {...} }). Used in reactivity systems (Vue 3), Immer-like patterns, validation layers, and logging. Enables meta-programming without modifying original object. Performance overhead vs direct access — fine for state management, not hot loops. Shows deep JS knowledge in senior interviews.Follow-up: Proxy vs Object.defineProperty?
125What is top-level await in modules?
Only in ES modules —
const config = await fetchConfig(); export default config;.Only in ES modules —
const config = await fetchConfig(); export default config;. Module importers wait until initialization completes. Useful for config loading in Node ESM and dynamic setup. Cannot use in scripts without type="module". Differs from async IIFE — cleaner syntax, graph-level blocking. Node and modern browsers support it.Follow-up: Circular dependency with top-level await?
126What is structuredClone and its limitations?
Clones nested objects, arrays, Dates, Maps, Sets, ArrayBuffers, and cyclic references.
Clones nested objects, arrays, Dates, Maps, Sets, ArrayBuffers, and cyclic references. Does not clone functions, DOM nodes, or certain symbols. Preferred over JSON.parse/stringify for deep copy in modern browsers and Node 17+. Still not universal substitute for domain-specific clone logic — know what types it handles. Interview: mention after JSON.stringify limitations.
Follow-up: structuredClone vs lodash cloneDeep?
Advanced Machine Coding
10 items127Implement production-grade debounce with leading and trailing edges.Infosys
Debounce delays execution until events stop for
wait ms.Debounce delays execution until events stop for
wait ms. Leading edge fires immediately then suppresses until quiet. Trailing fires after pause — default for search. Production version preserves this and args, exposes cancel and flush. Used in resize, search autocomplete, and window scroll end detection. Infosys frequently asks to code this live — know both edges and cleanup.Follow-up: debounce vs lodash debounce options?
``
javascript
function debounce(fn, wait, { leading = false, trailing = true } = {}) {
let timerId = null;
let lastArgs = null;
let lastThis = null;
function invoke() {
timerId = null;
if (trailing && lastArgs) fn.apply(lastThis, lastArgs);
lastArgs = lastThis = null;
}
function debounced(...args) {
lastArgs = args;
lastThis = this;
const isFirst = !timerId;
clearTimeout(timerId);
if (leading && isFirst) fn.apply(this, args);
timerId = setTimeout(invoke, wait);
}
debounced.cancel = () => {
clearTimeout(timerId);
timerId = lastArgs = lastThis = null;
};
debounced.flush = () => {
if (timerId) {
clearTimeout(timerId);
invoke();
}
};
return debounced;
}
``128Implement throttle with leading, trailing, and cancel.Infosys
Unlike debounce, throttle guarantees periodic execution during activity — scroll handlers, mouse move tracking, infinite scroll position checks.
Unlike debounce, throttle guarantees periodic execution during activity — scroll handlers, mouse move tracking, infinite scroll position checks. Track last run timestamp; schedule trailing call if invoked inside window. rAF-throttle variant syncs to paint. Infosys compares debounce vs throttle — throttle for steady feedback during action, debounce for end-of-action.
Follow-up: throttle with requestAnimationFrame?
``
javascript
function throttle(fn, wait) {
let last = 0;
let timerId = null;
let lastArgs = null;
let lastThis = null;
function trailingInvoke() {
last = Date.now();
timerId = null;
fn.apply(lastThis, lastArgs);
}
const throttled = function (...args) {
const now = Date.now();
const remaining = wait - (now - last);
lastArgs = args;
lastThis = this;
if (remaining <= 0 || remaining > wait) {
if (timerId) { clearTimeout(timerId); timerId = null; }
last = now;
fn.apply(this, args);
} else if (!timerId) {
timerId = setTimeout(trailingInvoke, remaining);
}
};
throttled.cancel = () => {
clearTimeout(timerId);
timerId = null;
lastArgs = lastThis = null;
};
return throttled;
}
``129Implement flatten with depth control and iterative fallback.Infosys
Recursive reduce is interview-clean; iterative stack handles very deep arrays without stack overflow.
Recursive reduce is interview-clean; iterative stack handles very deep arrays without stack overflow. Native
Array.flat(depth) in ES2019. Edge cases: sparse arrays, non-array elements, depth 0 returns shallow copy. Infosys may ask without flat() — show both recursive and iterative. Time O(n) total elements; space O(depth) recursive.Follow-up: flatMap vs map plus flat?
``
javascript
function flatten(arr, depth = Infinity) {
if (depth === 0) return arr.slice();
const result = [];
const stack = [{ items: arr, d: depth }];
while (stack.length) {
const { items, d } = stack.pop();
for (let i = items.length - 1; i >= 0; i--) {
const val = items[i];
if (Array.isArray(val) && d > 0) {
stack.push({ items: val, d: d - 1 });
} else {
result.unshift(val);
}
}
}
return result;
}
``130Implement deepClone handling cycles, Dates, and Maps.Infosys
JSON.stringify fails on functions, undefined, cycles, and loses Date type.
JSON.stringify fails on functions, undefined, cycles, and loses Date type. Production deepClone tracks visited objects in WeakMap to handle circular references. Handle Date, RegExp, Map, Set, ArrayBuffer as needed.
structuredClone covers many cases natively — interviewers want manual version understanding. State immutability in React depends on correct copying semantics.Follow-up: When is shallow copy enough?
``
javascript
function deepClone(value, seen = new WeakMap()) {
if (value === null || typeof value !== 'object') return value;
if (seen.has(value)) return seen.get(value);
if (value instanceof Date) return new Date(value);
if (value instanceof RegExp) return new RegExp(value);
if (value instanceof Map) {
const m = new Map();
seen.set(value, m);
value.forEach((v, k) => m.set(deepClone(k, seen), deepClone(v, seen)));
return m;
}
if (value instanceof Set) {
const s = new Set();
seen.set(value, s);
value.forEach(v => s.add(deepClone(v, seen)));
return s;
}
if (Array.isArray(value)) {
const arr = [];
seen.set(value, arr);
value.forEach((item, i) => { arr[i] = deepClone(item, seen); });
return arr;
}
const obj = {};
seen.set(value, obj);
for (const key of Object.keys(value)) {
obj[key] = deepClone(value[key], seen);
}
return obj;
}
``131Implement memoize with JSON key, custom resolver, and cache limit.Infosys
Basic memoize uses Map and JSON.stringify for keys — fails on functions and non-JSON values.
Basic memoize uses Map and JSON.stringify for keys — fails on functions and non-JSON values. Production version accepts
resolver(...args) for custom keys and max cache size with LRU eviction. Used in expensive compute — fibonacci, API response transform, selector-like utilities. React useMemo is component-scoped memoize. Clear cache method useful for tests.Follow-up: memoize vs React useMemo?
``
javascript
function memoize(fn, { resolver = (...args) => JSON.stringify(args), maxSize = Infinity } = {}) {
const cache = new Map();
function memoized(...args) {
const key = resolver(...args);
if (cache.has(key)) {
const val = cache.get(key);
cache.delete(key);
cache.set(key, val);
return val;
}
const result = fn.apply(this, args);
cache.set(key, result);
if (cache.size > maxSize) {
cache.delete(cache.keys().next().value);
}
return result;
}
memoized.cache = cache;
memoized.clear = () => cache.clear();
return memoized;
}
``132Implement compose and pipe utilities.
compose(f, g, h)(x) equals f(g(h(x))).compose(f, g, h)(x) equals f(g(h(x))). Used in functional pipelines and Redux middleware chain conceptually. Pipe reads naturally for data transformation steps. Both validate functions and return identity for empty list. Shows functional programming fluency common in JS interviews at product companies.Follow-up: compose vs Redux applyMiddleware?
``
javascript
const compose = (...fns) => fns.reduce((a, b) => (...args) => a(b(...args)));
const pipe = (...fns) => fns.reduce((a, b) => (...args) => b(a(...args)));
``133Implement once function wrapper.
Subsequent calls return cached value without re-invoking.
Subsequent calls return cached value without re-invoking. Useful for initialization, singleton API setup, and event handlers that should fire once. Track called flag and cached result. Handle void return separately. Variant
oncePerKey caches per argument hash for different inputs.Follow-up: once vs memoize for zero-arg functions?
``
javascript
function once(fn) {
let called = false;
let result;
return function (...args) {
if (!called) {
called = true;
result = fn.apply(this, args);
}
return result;
};
}
``134Implement async retry with exponential backoff.
Loop or recursive async function tries
fn() up to retries times.Loop or recursive async function tries
fn() up to retries times. On failure, wait delay * 2**attempt ms before retry. Used for flaky network, rate limits, and cloud API calls. Optionally jitter delay to avoid thundering herd. Infosys combines with Promise questions — show clean async/await version with try/catch.Follow-up: When not to retry?
``
javascript
async function retry(fn, { retries = 3, delay = 300 } = {}) {
let lastError;
for (let i = 0; i <= retries; i++) {
try {
return await fn();
} catch (err) {
lastError = err;
if (i < retries) await new Promise(r => setTimeout(r, delay * 2 ** i));
}
}
throw lastError;
}
``135Implement Promise.race with timeout wrapper.
Pattern:
Promise.race([promise, new Promise((_, rej) => setTimeout(() => rej(new Error('Timeout')), ms))]).Pattern:
Promise.race([promise, new Promise((_, rej) => setTimeout(() => rej(new Error('Timeout')), ms))]). Used for fetch deadlines and preventing hung UI. Clear timeout on success to avoid memory leaks in long-running apps. AbortController is modern fetch cancellation alternative. Both appear in senior frontend interviews.Follow-up: AbortController vs timeout race?
``
javascript
function withTimeout(promise, ms) {
let timer;
const timeout = new Promise((_, reject) => {
timer = setTimeout(() => reject(new Error(Timeout after ${ms}ms)), ms);
});
return Promise.race([promise, timeout]).finally(() => clearTimeout(timer));
}
``136JavaScript interview sound bite — language plus runtime.Must know
"JavaScript is single-threaded with an event loop — sync code on call stack, microtasks before macrotasks.
"JavaScript is single-threaded with an event loop — sync code on call stack, microtasks before macrotasks. I understand closures, prototypal inheritance, and
this binding rules. I use strict equality, avoid coercion pitfalls, and prefer const/let. For async I use async/await with proper error handling. I can implement debounce, throttle, deepClone, and memoize for machine coding rounds. In React apps I apply batching concepts and immutable updates. I know when to reach for structuredClone, WeakMap, and optional chaining in modern codebases."Follow-up: V8 optimization basics?
Total questions: 135