Expected answer: `typeof null` is the historical string `"object"`; it is a legacy language behavior and does not mean null is an object.
Reasoning: Tests the governing mechanism.
Common incorrect answer: `null` is implemented as an object in ECMAScript.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 03
Q022 — Debug a bug involving `typeof null`.
Level: Beginner
Category: `typeof null`
Expected answer: Apply this rule first: `typeof null` is the historical string `"object"`; it is a legacy language behavior and does not mean null is an object.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: `null` is implemented as an object in ECMAScript.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 03
Q023 — Name the misconception about `typeof null`.
Level: Beginner
Category: `typeof null`
Expected answer: Correct model: `typeof null` is the historical string `"object"`; it is a legacy language behavior and does not mean null is an object.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: `null` is implemented as an object in ECMAScript.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 03
Q024 — What production decision follows from `typeof null`?
Level: Beginner
Category: `typeof null`
Expected answer: Use this constraint: `typeof null` is the historical string `"object"`; it is a legacy language behavior and does not mean null is an object.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: `null` is implemented as an object in ECMAScript.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 03
Q025 — Define truthiness precisely.
Level: Beginner
Category: truthiness
Expected answer: ToBoolean maps a fixed set of values to false (`false`, `0`, `-0`, `0n`, `NaN`, empty string, `null`, `undefined`); ordinary objects are truthy.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Empty arrays and empty objects are falsy because they are empty.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 04
Q026 — Debug a bug involving truthiness.
Level: Beginner
Category: truthiness
Expected answer: Apply this rule first: ToBoolean maps a fixed set of values to false (`false`, `0`, `-0`, `0n`, `NaN`, empty string, `null`, `undefined`); ordinary objects are truthy.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Empty arrays and empty objects are falsy because they are empty.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 04
Q027 — Name the misconception about truthiness.
Level: Beginner
Category: truthiness
Expected answer: Correct model: ToBoolean maps a fixed set of values to false (`false`, `0`, `-0`, `0n`, `NaN`, empty string, `null`, `undefined`); ordinary objects are truthy.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Empty arrays and empty objects are falsy because they are empty.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 04
Q028 — What production decision follows from truthiness?
Level: Beginner
Category: truthiness
Expected answer: Use this constraint: ToBoolean maps a fixed set of values to false (`false`, `0`, `-0`, `0n`, `NaN`, empty string, `null`, `undefined`); ordinary objects are truthy.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Empty arrays and empty objects are falsy because they are empty.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 04
Q029 — Define ToPrimitive precisely.
Level: Beginner
Category: ToPrimitive
Expected answer: Object-to-primitive conversion consults `Symbol.toPrimitive` first, then legacy methods in an order determined by the hint; operators may then convert the primitive further.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Objects always call `toString()` before `valueOf()`.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 04
Q030 — Debug a bug involving ToPrimitive.
Level: Beginner
Category: ToPrimitive
Expected answer: Apply this rule first: Object-to-primitive conversion consults `Symbol.toPrimitive` first, then legacy methods in an order determined by the hint; operators may then convert the primitive further.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Objects always call `toString()` before `valueOf()`.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 04
Q031 — Name the misconception about ToPrimitive.
Level: Beginner
Category: ToPrimitive
Expected answer: Correct model: Object-to-primitive conversion consults `Symbol.toPrimitive` first, then legacy methods in an order determined by the hint; operators may then convert the primitive further.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Objects always call `toString()` before `valueOf()`.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 04
Q032 — What production decision follows from ToPrimitive?
Level: Beginner
Category: ToPrimitive
Expected answer: Use this constraint: Object-to-primitive conversion consults `Symbol.toPrimitive` first, then legacy methods in an order determined by the hint; operators may then convert the primitive further.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Objects always call `toString()` before `valueOf()`.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 04
Q033 — Define loose equality precisely.
Level: Beginner
Category: loose equality
Expected answer: `==` follows Abstract Equality rules that may coerce types; odd cases should be derived from the algorithm rather than memorized.
Reasoning: Tests the governing mechanism.
Common incorrect answer: `==` is random and should never be reasoned about.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 05
Q034 — Debug a bug involving loose equality.
Level: Beginner
Category: loose equality
Expected answer: Apply this rule first: `==` follows Abstract Equality rules that may coerce types; odd cases should be derived from the algorithm rather than memorized.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: `==` is random and should never be reasoned about.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 05
Q035 — Name the misconception about loose equality.
Level: Beginner
Category: loose equality
Expected answer: Correct model: `==` follows Abstract Equality rules that may coerce types; odd cases should be derived from the algorithm rather than memorized.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: `==` is random and should never be reasoned about.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 05
Q036 — What production decision follows from loose equality?
Level: Beginner
Category: loose equality
Expected answer: Use this constraint: `==` follows Abstract Equality rules that may coerce types; odd cases should be derived from the algorithm rather than memorized.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: `==` is random and should never be reasoned about.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 05
Q037 — Define SameValueZero precisely.
Level: Beginner
Category: SameValueZero
Expected answer: SameValueZero treats `NaN` as equal to itself and treats `+0` and `-0` as equal; it is used by APIs such as `Set`, `Map` key matching, and `Array.prototype.includes`.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Every JavaScript API uses `===` for equality.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 05
Q038 — Debug a bug involving SameValueZero.
Level: Beginner
Category: SameValueZero
Expected answer: Apply this rule first: SameValueZero treats `NaN` as equal to itself and treats `+0` and `-0` as equal; it is used by APIs such as `Set`, `Map` key matching, and `Array.prototype.includes`.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Every JavaScript API uses `===` for equality.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 05
Q039 — Name the misconception about SameValueZero.
Level: Beginner
Category: SameValueZero
Expected answer: Correct model: SameValueZero treats `NaN` as equal to itself and treats `+0` and `-0` as equal; it is used by APIs such as `Set`, `Map` key matching, and `Array.prototype.includes`.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Every JavaScript API uses `===` for equality.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 05
Q040 — What production decision follows from SameValueZero?
Level: Beginner
Category: SameValueZero
Expected answer: Use this constraint: SameValueZero treats `NaN` as equal to itself and treats `+0` and `-0` as equal; it is used by APIs such as `Set`, `Map` key matching, and `Array.prototype.includes`.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Every JavaScript API uses `===` for equality.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 05
Q041 — Define short-circuiting precisely.
Level: Beginner
Category: short-circuiting
Expected answer: `&&`, `||`, `??`, optional chaining, and logical assignment conditionally skip evaluation; they return/assign based on value semantics rather than converting the final result to Boolean.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Logical operators always return booleans.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 06
Q042 — Debug a bug involving short-circuiting.
Level: Beginner
Category: short-circuiting
Expected answer: Apply this rule first: `&&`, `||`, `??`, optional chaining, and logical assignment conditionally skip evaluation; they return/assign based on value semantics rather than converting the final result to Boolean.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Logical operators always return booleans.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 06
Q043 — Name the misconception about short-circuiting.
Level: Beginner
Category: short-circuiting
Expected answer: Correct model: `&&`, `||`, `??`, optional chaining, and logical assignment conditionally skip evaluation; they return/assign based on value semantics rather than converting the final result to Boolean.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Logical operators always return booleans.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 06
Q044 — What production decision follows from short-circuiting?
Level: Beginner
Category: short-circuiting
Expected answer: Use this constraint: `&&`, `||`, `??`, optional chaining, and logical assignment conditionally skip evaluation; they return/assign based on value semantics rather than converting the final result to Boolean.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Logical operators always return booleans.
Expected answer: An optional chain short-circuits only along the continuous chain; grouping can end the chain so a later property access may still throw.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Once `?.` appears anywhere in an expression the rest can never throw for nullish access.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 06
Q046 — Debug a bug involving optional chaining grouping.
Level: Beginner
Category: optional chaining grouping
Expected answer: Apply this rule first: An optional chain short-circuits only along the continuous chain; grouping can end the chain so a later property access may still throw.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Once `?.` appears anywhere in an expression the rest can never throw for nullish access.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 06
Q047 — Name the misconception about optional chaining grouping.
Level: Beginner
Category: optional chaining grouping
Expected answer: Correct model: An optional chain short-circuits only along the continuous chain; grouping can end the chain so a later property access may still throw.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Once `?.` appears anywhere in an expression the rest can never throw for nullish access.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 06
Q048 — What production decision follows from optional chaining grouping?
Level: Beginner
Category: optional chaining grouping
Expected answer: Use this constraint: An optional chain short-circuits only along the continuous chain; grouping can end the chain so a later property access may still throw.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Once `?.` appears anywhere in an expression the rest can never throw for nullish access.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 06
Q049 — Define `finally` completion precisely.
Level: Beginner
Category: `finally` completion
Expected answer: A `finally` block always executes after try/catch completion and an abrupt completion from `finally` can replace an earlier return or throw.
Reasoning: Tests the governing mechanism.
Common incorrect answer: `finally` can observe an error but cannot change the function result.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 07
Q050 — Debug a bug involving `finally` completion.
Level: Beginner
Category: `finally` completion
Expected answer: Apply this rule first: A `finally` block always executes after try/catch completion and an abrupt completion from `finally` can replace an earlier return or throw.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: `finally` can observe an error but cannot change the function result.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 07
Q051 — Name the misconception about `finally` completion.
Level: Beginner
Category: `finally` completion
Expected answer: Correct model: A `finally` block always executes after try/catch completion and an abrupt completion from `finally` can replace an earlier return or throw.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: `finally` can observe an error but cannot change the function result.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 07
Q052 — What production decision follows from `finally` completion?
Level: Beginner
Category: `finally` completion
Expected answer: Use this constraint: A `finally` block always executes after try/catch completion and an abrupt completion from `finally` can replace an earlier return or throw.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: `finally` can observe an error but cannot change the function result.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 07
Q053 — Define `for...in` vs `for...of` precisely.
Level: Beginner
Category: `for...in` vs `for...of`
Expected answer: `for...in` enumerates enumerable string property keys, including inherited ones; `for...of` consumes the iterable protocol and yields values.
Reasoning: Tests the governing mechanism.
Common incorrect answer: `for...in` is the normal way to iterate array values.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 08
Q054 — Debug a bug involving `for...in` vs `for...of`.
Level: Beginner
Category: `for...in` vs `for...of`
Expected answer: Apply this rule first: `for...in` enumerates enumerable string property keys, including inherited ones; `for...of` consumes the iterable protocol and yields values.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: `for...in` is the normal way to iterate array values.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 08
Q055 — Name the misconception about `for...in` vs `for...of`.
Level: Beginner
Category: `for...in` vs `for...of`
Expected answer: Correct model: `for...in` enumerates enumerable string property keys, including inherited ones; `for...of` consumes the iterable protocol and yields values.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: `for...in` is the normal way to iterate array values.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 08
Q056 — What production decision follows from `for...in` vs `for...of`?
Level: Beginner
Category: `for...in` vs `for...of`
Expected answer: Use this constraint: `for...in` enumerates enumerable string property keys, including inherited ones; `for...of` consumes the iterable protocol and yields values.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: `for...in` is the normal way to iterate array values.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 08
Q057 — Define mutation during iteration precisely.
Level: Beginner
Category: mutation during iteration
Expected answer: Iteration behavior depends on the specific algorithm and collection; mutating arrays/maps/sets during traversal can change what is visited and should not be generalized from one method.
Reasoning: Tests the governing mechanism.
Common incorrect answer: All iterators take a snapshot before iteration starts.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 08
Q058 — Debug a bug involving mutation during iteration.
Level: Beginner
Category: mutation during iteration
Expected answer: Apply this rule first: Iteration behavior depends on the specific algorithm and collection; mutating arrays/maps/sets during traversal can change what is visited and should not be generalized from one method.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: All iterators take a snapshot before iteration starts.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 08
Q059 — Name the misconception about mutation during iteration.
Level: Beginner
Category: mutation during iteration
Expected answer: Correct model: Iteration behavior depends on the specific algorithm and collection; mutating arrays/maps/sets during traversal can change what is visited and should not be generalized from one method.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: All iterators take a snapshot before iteration starts.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 08
Q060 — What production decision follows from mutation during iteration?
Level: Beginner
Category: mutation during iteration
Expected answer: Use this constraint: Iteration behavior depends on the specific algorithm and collection; mutating arrays/maps/sets during traversal can change what is visited and should not be generalized from one method.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: All iterators take a snapshot before iteration starts.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 08
Q061 — Define function declarations vs expressions precisely.
Level: Beginner
Category: function declarations vs expressions
Expected answer: Function declarations create bindings during instantiation; expressions create function values when evaluated. Named function expressions also provide an inner self-name.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Declarations and expressions differ only in style.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 09
Q062 — Debug a bug involving function declarations vs expressions.
Level: Beginner
Category: function declarations vs expressions
Expected answer: Apply this rule first: Function declarations create bindings during instantiation; expressions create function values when evaluated. Named function expressions also provide an inner self-name.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Declarations and expressions differ only in style.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 09
Q063 — Name the misconception about function declarations vs expressions.
Level: Beginner
Category: function declarations vs expressions
Expected answer: Correct model: Function declarations create bindings during instantiation; expressions create function values when evaluated. Named function expressions also provide an inner self-name.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Declarations and expressions differ only in style.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 09
Q064 — What production decision follows from function declarations vs expressions?
Level: Beginner
Category: function declarations vs expressions
Expected answer: Use this constraint: Function declarations create bindings during instantiation; expressions create function values when evaluated. Named function expressions also provide an inner self-name.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Declarations and expressions differ only in style.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 09
Q065 — Define default parameters precisely.
Level: Beginner
Category: default parameters
Expected answer: Default parameter initializers run at call time in a parameter environment and only apply when the argument is `undefined`, not for other falsy values.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Defaults run once when the function is defined.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 09
Q066 — Debug a bug involving default parameters.
Level: Beginner
Category: default parameters
Expected answer: Apply this rule first: Default parameter initializers run at call time in a parameter environment and only apply when the argument is `undefined`, not for other falsy values.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Defaults run once when the function is defined.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 09
Q067 — Name the misconception about default parameters.
Level: Beginner
Category: default parameters
Expected answer: Correct model: Default parameter initializers run at call time in a parameter environment and only apply when the argument is `undefined`, not for other falsy values.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Defaults run once when the function is defined.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 09
Q068 — What production decision follows from default parameters?
Level: Beginner
Category: default parameters
Expected answer: Use this constraint: Default parameter initializers run at call time in a parameter environment and only apply when the argument is `undefined`, not for other falsy values.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Defaults run once when the function is defined.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 09
Q069 — Define closures precisely.
Level: Beginner
Category: closures
Expected answer: Closures preserve access to lexical bindings reachable from a function, which can keep associated values alive and observe later binding updates.
Reasoning: Tests the governing mechanism.
Common incorrect answer: A closure copies all outer variable values when the function is created.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 10
Q070 — Debug a bug involving closures.
Level: Beginner
Category: closures
Expected answer: Apply this rule first: Closures preserve access to lexical bindings reachable from a function, which can keep associated values alive and observe later binding updates.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: A closure copies all outer variable values when the function is created.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 10
Q071 — Name the misconception about closures.
Level: Beginner
Category: closures
Expected answer: Correct model: Closures preserve access to lexical bindings reachable from a function, which can keep associated values alive and observe later binding updates.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: A closure copies all outer variable values when the function is created.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 10
Q072 — What production decision follows from closures?
Level: Beginner
Category: closures
Expected answer: Use this constraint: Closures preserve access to lexical bindings reachable from a function, which can keep associated values alive and observe later binding updates.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: A closure copies all outer variable values when the function is created.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 10
Q073 — Define execution context vs stack frame precisely.
Level: Beginner
Category: execution context vs stack frame
Expected answer: Execution contexts are specification models for running code; physical stack frames are implementation details. They are related mental models but not identical guarantees.
Reasoning: Tests the governing mechanism.
Common incorrect answer: ECMA-262 requires a concrete stack frame for every function call.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 10
Q074 — Debug a bug involving execution context vs stack frame.
Level: Beginner
Category: execution context vs stack frame
Expected answer: Apply this rule first: Execution contexts are specification models for running code; physical stack frames are implementation details. They are related mental models but not identical guarantees.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: ECMA-262 requires a concrete stack frame for every function call.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 10
Q075 — Name the misconception about execution context vs stack frame.
Level: Beginner
Category: execution context vs stack frame
Expected answer: Correct model: Execution contexts are specification models for running code; physical stack frames are implementation details. They are related mental models but not identical guarantees.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: ECMA-262 requires a concrete stack frame for every function call.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 10
Q076 — What production decision follows from execution context vs stack frame?
Level: Intermediate
Category: execution context vs stack frame
Expected answer: Use this constraint: Execution contexts are specification models for running code; physical stack frames are implementation details. They are related mental models but not identical guarantees.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: ECMA-262 requires a concrete stack frame for every function call.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 10
Q077 — Define ordinary-function `this` precisely.
Level: Intermediate
Category: ordinary-function `this`
Expected answer: For ordinary functions, `this` is determined by invocation form/receiver and strictness (plus explicit binding/constructor cases), not by lexical definition location.
Reasoning: Tests the governing mechanism.
Common incorrect answer: `this` always means the object where the function was written.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 11
Q078 — Debug a bug involving ordinary-function `this`.
Level: Intermediate
Category: ordinary-function `this`
Expected answer: Apply this rule first: For ordinary functions, `this` is determined by invocation form/receiver and strictness (plus explicit binding/constructor cases), not by lexical definition location.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: `this` always means the object where the function was written.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 11
Q079 — Name the misconception about ordinary-function `this`.
Level: Intermediate
Category: ordinary-function `this`
Expected answer: Correct model: For ordinary functions, `this` is determined by invocation form/receiver and strictness (plus explicit binding/constructor cases), not by lexical definition location.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: `this` always means the object where the function was written.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 11
Q080 — What production decision follows from ordinary-function `this`?
Level: Intermediate
Category: ordinary-function `this`
Expected answer: Use this constraint: For ordinary functions, `this` is determined by invocation form/receiver and strictness (plus explicit binding/constructor cases), not by lexical definition location.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: `this` always means the object where the function was written.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 11
Q081 — Define arrow `this` precisely.
Level: Intermediate
Category: arrow `this`
Expected answer: Arrow functions do not define their own `this`; they capture the surrounding lexical `this` behavior and cannot be used as constructors.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Arrow functions bind `this` to the object on their left.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 11
Q082 — Debug a bug involving arrow `this`.
Level: Intermediate
Category: arrow `this`
Expected answer: Apply this rule first: Arrow functions do not define their own `this`; they capture the surrounding lexical `this` behavior and cannot be used as constructors.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Arrow functions bind `this` to the object on their left.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 11
Q083 — Name the misconception about arrow `this`.
Level: Intermediate
Category: arrow `this`
Expected answer: Correct model: Arrow functions do not define their own `this`; they capture the surrounding lexical `this` behavior and cannot be used as constructors.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Arrow functions bind `this` to the object on their left.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 11
Q084 — What production decision follows from arrow `this`?
Level: Intermediate
Category: arrow `this`
Expected answer: Use this constraint: Arrow functions do not define their own `this`; they capture the surrounding lexical `this` behavior and cannot be used as constructors.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Arrow functions bind `this` to the object on their left.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 11
Q085 — Define `call`/`apply`/`bind` precisely.
Level: Intermediate
Category: `call`/`apply`/`bind`
Expected answer: `call` and `apply` invoke immediately with an explicit receiver; `bind` creates a new bound function with stored receiver/leading arguments and special constructor behavior.
Reasoning: Tests the governing mechanism.
Common incorrect answer: `bind` mutates the original function's `this`.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 12
Q086 — Debug a bug involving `call`/`apply`/`bind`.
Level: Intermediate
Category: `call`/`apply`/`bind`
Expected answer: Apply this rule first: `call` and `apply` invoke immediately with an explicit receiver; `bind` creates a new bound function with stored receiver/leading arguments and special constructor behavior.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: `bind` mutates the original function's `this`.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 12
Q087 — Name the misconception about `call`/`apply`/`bind`.
Level: Intermediate
Category: `call`/`apply`/`bind`
Expected answer: Correct model: `call` and `apply` invoke immediately with an explicit receiver; `bind` creates a new bound function with stored receiver/leading arguments and special constructor behavior.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: `bind` mutates the original function's `this`.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 12
Q088 — What production decision follows from `call`/`apply`/`bind`?
Level: Intermediate
Category: `call`/`apply`/`bind`
Expected answer: Use this constraint: `call` and `apply` invoke immediately with an explicit receiver; `bind` creates a new bound function with stored receiver/leading arguments and special constructor behavior.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: `bind` mutates the original function's `this`.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 12
Q089 — Define constructor invocation precisely.
Level: Intermediate
Category: constructor invocation
Expected answer: `new F()` creates/chooses an object, sets prototype linkage from `F.prototype`, calls `F` with constructor semantics, and uses an explicitly returned object when one is returned.
Reasoning: Tests the governing mechanism.
Common incorrect answer: `new` just calls a function and always returns the newly allocated object.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 12
Q090 — Debug a bug involving constructor invocation.
Level: Intermediate
Category: constructor invocation
Expected answer: Apply this rule first: `new F()` creates/chooses an object, sets prototype linkage from `F.prototype`, calls `F` with constructor semantics, and uses an explicitly returned object when one is returned.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: `new` just calls a function and always returns the newly allocated object.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 12
Q091 — Name the misconception about constructor invocation.
Level: Intermediate
Category: constructor invocation
Expected answer: Correct model: `new F()` creates/chooses an object, sets prototype linkage from `F.prototype`, calls `F` with constructor semantics, and uses an explicitly returned object when one is returned.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: `new` just calls a function and always returns the newly allocated object.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 12
Q092 — What production decision follows from constructor invocation?
Level: Intermediate
Category: constructor invocation
Expected answer: Use this constraint: `new F()` creates/chooses an object, sets prototype linkage from `F.prototype`, calls `F` with constructor semantics, and uses an explicitly returned object when one is returned.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: `new` just calls a function and always returns the newly allocated object.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 12
Q093 — Define property keys precisely.
Level: Intermediate
Category: property keys
Expected answer: Ordinary object property keys are strings or symbols; numeric-looking keys are converted to strings, while property ordering has defined categories rather than simple insertion order for every key.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Object keys can be arbitrary object values like Map keys.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 13
Q094 — Debug a bug involving property keys.
Level: Intermediate
Category: property keys
Expected answer: Apply this rule first: Ordinary object property keys are strings or symbols; numeric-looking keys are converted to strings, while property ordering has defined categories rather than simple insertion order for every key.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Object keys can be arbitrary object values like Map keys.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 13
Q095 — Name the misconception about property keys.
Level: Intermediate
Category: property keys
Expected answer: Correct model: Ordinary object property keys are strings or symbols; numeric-looking keys are converted to strings, while property ordering has defined categories rather than simple insertion order for every key.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Object keys can be arbitrary object values like Map keys.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 13
Q096 — What production decision follows from property keys?
Level: Intermediate
Category: property keys
Expected answer: Use this constraint: Ordinary object property keys are strings or symbols; numeric-looking keys are converted to strings, while property ordering has defined categories rather than simple insertion order for every key.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Object keys can be arbitrary object values like Map keys.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 13
Q097 — Define own vs inherited properties precisely.
Level: Intermediate
Category: own vs inherited properties
Expected answer: Property lookup can traverse `[[Prototype]]`; ownership checks such as `Object.hasOwn` distinguish direct properties from inherited ones.
Reasoning: Tests the governing mechanism.
Common incorrect answer: If `key in obj` is true then the property is necessarily own.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 13
Q098 — Debug a bug involving own vs inherited properties.
Level: Intermediate
Category: own vs inherited properties
Expected answer: Apply this rule first: Property lookup can traverse `[[Prototype]]`; ownership checks such as `Object.hasOwn` distinguish direct properties from inherited ones.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: If `key in obj` is true then the property is necessarily own.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 13
Q099 — Name the misconception about own vs inherited properties.
Level: Intermediate
Category: own vs inherited properties
Expected answer: Correct model: Property lookup can traverse `[[Prototype]]`; ownership checks such as `Object.hasOwn` distinguish direct properties from inherited ones.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: If `key in obj` is true then the property is necessarily own.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 13
Q100 — What production decision follows from own vs inherited properties?
Level: Intermediate
Category: own vs inherited properties
Expected answer: Use this constraint: Property lookup can traverse `[[Prototype]]`; ownership checks such as `Object.hasOwn` distinguish direct properties from inherited ones.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: If `key in obj` is true then the property is necessarily own.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 13
Q101 — Define property descriptors precisely.
Level: Intermediate
Category: property descriptors
Expected answer: Data descriptors use value/writable; accessor descriptors use get/set; enumerable and configurable affect visibility/redefinition/deletion. Descriptor defaults can be surprising in `defineProperty`.
Reasoning: Tests the governing mechanism.
Common incorrect answer: All object properties are writable, enumerable, and configurable by default regardless of how created.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 14
Q102 — Debug a bug involving property descriptors.
Level: Intermediate
Category: property descriptors
Expected answer: Apply this rule first: Data descriptors use value/writable; accessor descriptors use get/set; enumerable and configurable affect visibility/redefinition/deletion. Descriptor defaults can be surprising in `defineProperty`.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: All object properties are writable, enumerable, and configurable by default regardless of how created.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 14
Q103 — Name the misconception about property descriptors.
Level: Intermediate
Category: property descriptors
Expected answer: Correct model: Data descriptors use value/writable; accessor descriptors use get/set; enumerable and configurable affect visibility/redefinition/deletion. Descriptor defaults can be surprising in `defineProperty`.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: All object properties are writable, enumerable, and configurable by default regardless of how created.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 14
Q104 — What production decision follows from property descriptors?
Level: Intermediate
Category: property descriptors
Expected answer: Use this constraint: Data descriptors use value/writable; accessor descriptors use get/set; enumerable and configurable affect visibility/redefinition/deletion. Descriptor defaults can be surprising in `defineProperty`.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: All object properties are writable, enumerable, and configurable by default regardless of how created.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 14
Q105 — Define freeze is shallow precisely.
Level: Intermediate
Category: freeze is shallow
Expected answer: `Object.freeze` prevents own-property reconfiguration/writes on that object but does not recursively freeze referenced objects.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Freezing an object makes the entire reachable graph immutable.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 15
Q106 — Debug a bug involving freeze is shallow.
Level: Intermediate
Category: freeze is shallow
Expected answer: Apply this rule first: `Object.freeze` prevents own-property reconfiguration/writes on that object but does not recursively freeze referenced objects.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Freezing an object makes the entire reachable graph immutable.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 15
Q107 — Name the misconception about freeze is shallow.
Level: Intermediate
Category: freeze is shallow
Expected answer: Correct model: `Object.freeze` prevents own-property reconfiguration/writes on that object but does not recursively freeze referenced objects.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Freezing an object makes the entire reachable graph immutable.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 15
Q108 — What production decision follows from freeze is shallow?
Level: Intermediate
Category: freeze is shallow
Expected answer: Use this constraint: `Object.freeze` prevents own-property reconfiguration/writes on that object but does not recursively freeze referenced objects.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Freezing an object makes the entire reachable graph immutable.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 15
Q109 — Define prototype chain precisely.
Level: Intermediate
Category: prototype chain
Expected answer: Objects delegate missing-property lookup through `[[Prototype]]` until a property is found or `null` is reached.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Prototype inheritance copies methods into each instance.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 16
Q110 — Debug a bug involving prototype chain.
Level: Intermediate
Category: prototype chain
Expected answer: Apply this rule first: Objects delegate missing-property lookup through `[[Prototype]]` until a property is found or `null` is reached.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Prototype inheritance copies methods into each instance.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 16
Q111 — Name the misconception about prototype chain.
Level: Intermediate
Category: prototype chain
Expected answer: Correct model: Objects delegate missing-property lookup through `[[Prototype]]` until a property is found or `null` is reached.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Prototype inheritance copies methods into each instance.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 16
Q112 — What production decision follows from prototype chain?
Level: Intermediate
Category: prototype chain
Expected answer: Use this constraint: Objects delegate missing-property lookup through `[[Prototype]]` until a property is found or `null` is reached.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Prototype inheritance copies methods into each instance.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 16
Q113 — Define prototype pollution precisely.
Level: Intermediate
Category: prototype pollution
Expected answer: Prototype pollution occurs when untrusted keys modify shared prototypes or prototype-bearing objects, affecting unrelated lookups; safe key handling and null-prototype/dedicated maps can reduce risk.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Prototype pollution only matters if code explicitly calls `Object.setPrototypeOf`.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 16
Q114 — Debug a bug involving prototype pollution.
Level: Intermediate
Category: prototype pollution
Expected answer: Apply this rule first: Prototype pollution occurs when untrusted keys modify shared prototypes or prototype-bearing objects, affecting unrelated lookups; safe key handling and null-prototype/dedicated maps can reduce risk.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Prototype pollution only matters if code explicitly calls `Object.setPrototypeOf`.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 16
Q115 — Name the misconception about prototype pollution.
Level: Intermediate
Category: prototype pollution
Expected answer: Correct model: Prototype pollution occurs when untrusted keys modify shared prototypes or prototype-bearing objects, affecting unrelated lookups; safe key handling and null-prototype/dedicated maps can reduce risk.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Prototype pollution only matters if code explicitly calls `Object.setPrototypeOf`.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 16
Q116 — What production decision follows from prototype pollution?
Level: Intermediate
Category: prototype pollution
Expected answer: Use this constraint: Prototype pollution occurs when untrusted keys modify shared prototypes or prototype-bearing objects, affecting unrelated lookups; safe key handling and null-prototype/dedicated maps can reduce risk.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Prototype pollution only matters if code explicitly calls `Object.setPrototypeOf`.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 16
Q117 — Define classes and prototypes precisely.
Level: Intermediate
Category: classes and prototypes
Expected answer: Class methods live on prototypes and inheritance uses the prototype system; classes add strict semantics, fields, private elements, `super`, and structured syntax.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Classes replaced JavaScript's prototype model with classical inheritance.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 17
Q118 — Debug a bug involving classes and prototypes.
Level: Intermediate
Category: classes and prototypes
Expected answer: Apply this rule first: Class methods live on prototypes and inheritance uses the prototype system; classes add strict semantics, fields, private elements, `super`, and structured syntax.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Classes replaced JavaScript's prototype model with classical inheritance.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 17
Q119 — Name the misconception about classes and prototypes.
Level: Intermediate
Category: classes and prototypes
Expected answer: Correct model: Class methods live on prototypes and inheritance uses the prototype system; classes add strict semantics, fields, private elements, `super`, and structured syntax.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Classes replaced JavaScript's prototype model with classical inheritance.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 17
Q120 — What production decision follows from classes and prototypes?
Level: Intermediate
Category: classes and prototypes
Expected answer: Use this constraint: Class methods live on prototypes and inheritance uses the prototype system; classes add strict semantics, fields, private elements, `super`, and structured syntax.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Classes replaced JavaScript's prototype model with classical inheritance.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 17
Q121 — Define private fields precisely.
Level: Intermediate
Category: private fields
Expected answer: `#private` elements use private names/brand checks and are not ordinary string-keyed properties accessible through reflection or bracket syntax.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Private fields are normal properties whose names merely start with `#`.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 17
Q122 — Debug a bug involving private fields.
Level: Intermediate
Category: private fields
Expected answer: Apply this rule first: `#private` elements use private names/brand checks and are not ordinary string-keyed properties accessible through reflection or bracket syntax.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Private fields are normal properties whose names merely start with `#`.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 17
Q123 — Name the misconception about private fields.
Level: Intermediate
Category: private fields
Expected answer: Correct model: `#private` elements use private names/brand checks and are not ordinary string-keyed properties accessible through reflection or bracket syntax.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Private fields are normal properties whose names merely start with `#`.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 17
Q124 — What production decision follows from private fields?
Level: Intermediate
Category: private fields
Expected answer: Use this constraint: `#private` elements use private names/brand checks and are not ordinary string-keyed properties accessible through reflection or bracket syntax.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Private fields are normal properties whose names merely start with `#`.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 17
Q125 — Define sparse arrays precisely.
Level: Intermediate
Category: sparse arrays
Expected answer: Array holes are absent indexed properties, not explicit `undefined`; methods differ in whether they skip holes, preserve them, or materialize values.
Reasoning: Tests the governing mechanism.
Common incorrect answer: A hole and an element containing `undefined` are always equivalent.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 18
Q126 — Debug a bug involving sparse arrays.
Level: Intermediate
Category: sparse arrays
Expected answer: Apply this rule first: Array holes are absent indexed properties, not explicit `undefined`; methods differ in whether they skip holes, preserve them, or materialize values.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: A hole and an element containing `undefined` are always equivalent.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 18
Q127 — Name the misconception about sparse arrays.
Level: Intermediate
Category: sparse arrays
Expected answer: Correct model: Array holes are absent indexed properties, not explicit `undefined`; methods differ in whether they skip holes, preserve them, or materialize values.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: A hole and an element containing `undefined` are always equivalent.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 18
Q128 — What production decision follows from sparse arrays?
Level: Intermediate
Category: sparse arrays
Expected answer: Use this constraint: Array holes are absent indexed properties, not explicit `undefined`; methods differ in whether they skip holes, preserve them, or materialize values.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: A hole and an element containing `undefined` are always equivalent.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 18
Q129 — Define copy-by-change arrays precisely.
Level: Intermediate
Category: copy-by-change arrays
Expected answer: `toSorted`, `toReversed`, `toSpliced`, and `with` return changed copies instead of mutating the receiver, but the copies remain shallow.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Non-mutating array methods deep-clone their elements.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 18
Q130 — Debug a bug involving copy-by-change arrays.
Level: Intermediate
Category: copy-by-change arrays
Expected answer: Apply this rule first: `toSorted`, `toReversed`, `toSpliced`, and `with` return changed copies instead of mutating the receiver, but the copies remain shallow.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Non-mutating array methods deep-clone their elements.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 18
Q131 — Name the misconception about copy-by-change arrays.
Level: Intermediate
Category: copy-by-change arrays
Expected answer: Correct model: `toSorted`, `toReversed`, `toSpliced`, and `with` return changed copies instead of mutating the receiver, but the copies remain shallow.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Non-mutating array methods deep-clone their elements.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 18
Q132 — What production decision follows from copy-by-change arrays?
Level: Intermediate
Category: copy-by-change arrays
Expected answer: Use this constraint: `toSorted`, `toReversed`, `toSpliced`, and `with` return changed copies instead of mutating the receiver, but the copies remain shallow.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Non-mutating array methods deep-clone their elements.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 18
Q133 — Define Unicode strings precisely.
Level: Intermediate
Category: Unicode strings
Expected answer: JavaScript strings are sequences of UTF-16 code units; iteration is code-point aware, while `.length` counts code units and user-perceived graphemes may require `Intl.Segmenter`.
Reasoning: Tests the governing mechanism.
Common incorrect answer: String length always equals the number of visible characters.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 19
Q134 — Debug a bug involving Unicode strings.
Level: Intermediate
Category: Unicode strings
Expected answer: Apply this rule first: JavaScript strings are sequences of UTF-16 code units; iteration is code-point aware, while `.length` counts code units and user-perceived graphemes may require `Intl.Segmenter`.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: String length always equals the number of visible characters.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 19
Q135 — Name the misconception about Unicode strings.
Level: Intermediate
Category: Unicode strings
Expected answer: Correct model: JavaScript strings are sequences of UTF-16 code units; iteration is code-point aware, while `.length` counts code units and user-perceived graphemes may require `Intl.Segmenter`.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: String length always equals the number of visible characters.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 19
Q136 — What production decision follows from Unicode strings?
Level: Intermediate
Category: Unicode strings
Expected answer: Use this constraint: JavaScript strings are sequences of UTF-16 code units; iteration is code-point aware, while `.length` counts code units and user-perceived graphemes may require `Intl.Segmenter`.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: String length always equals the number of visible characters.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 19
Q137 — Define floating point precisely.
Level: Intermediate
Category: floating point
Expected answer: Number uses IEEE-754 binary64, so many decimal fractions are not exactly representable; `0.1 + 0.2` reflects representation/rounding rather than random arithmetic.
Reasoning: Tests the governing mechanism.
Common incorrect answer: JavaScript uses decimal floating point for ordinary Number values.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 20
Q138 — Debug a bug involving floating point.
Level: Intermediate
Category: floating point
Expected answer: Apply this rule first: Number uses IEEE-754 binary64, so many decimal fractions are not exactly representable; `0.1 + 0.2` reflects representation/rounding rather than random arithmetic.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: JavaScript uses decimal floating point for ordinary Number values.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 20
Q139 — Name the misconception about floating point.
Level: Intermediate
Category: floating point
Expected answer: Correct model: Number uses IEEE-754 binary64, so many decimal fractions are not exactly representable; `0.1 + 0.2` reflects representation/rounding rather than random arithmetic.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: JavaScript uses decimal floating point for ordinary Number values.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 20
Q140 — What production decision follows from floating point?
Level: Intermediate
Category: floating point
Expected answer: Use this constraint: Number uses IEEE-754 binary64, so many decimal fractions are not exactly representable; `0.1 + 0.2` reflects representation/rounding rather than random arithmetic.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: JavaScript uses decimal floating point for ordinary Number values.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 20
Q141 — Define `NaN` and `-0` precisely.
Level: Intermediate
Category: `NaN` and `-0`
Expected answer: `NaN` is unequal to itself under `===`; `Object.is` distinguishes `-0` from `+0` and treats NaN as same. Different APIs choose different equality relations.
Reasoning: Tests the governing mechanism.
Common incorrect answer: There is only one equality relation in JavaScript.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 20
Q142 — Debug a bug involving `NaN` and `-0`.
Level: Intermediate
Category: `NaN` and `-0`
Expected answer: Apply this rule first: `NaN` is unequal to itself under `===`; `Object.is` distinguishes `-0` from `+0` and treats NaN as same. Different APIs choose different equality relations.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: There is only one equality relation in JavaScript.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 20
Q143 — Name the misconception about `NaN` and `-0`.
Level: Intermediate
Category: `NaN` and `-0`
Expected answer: Correct model: `NaN` is unequal to itself under `===`; `Object.is` distinguishes `-0` from `+0` and treats NaN as same. Different APIs choose different equality relations.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: There is only one equality relation in JavaScript.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 20
Q144 — What production decision follows from `NaN` and `-0`?
Level: Intermediate
Category: `NaN` and `-0`
Expected answer: Use this constraint: `NaN` is unequal to itself under `===`; `Object.is` distinguishes `-0` from `+0` and treats NaN as same. Different APIs choose different equality relations.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: There is only one equality relation in JavaScript.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 20
Q145 — Define BigInt interoperability precisely.
Level: Intermediate
Category: BigInt interoperability
Expected answer: BigInt supports integer arithmetic of arbitrary magnitude but cannot be mixed directly with Number arithmetic; comparison has specific interoperability rules and JSON needs an explicit strategy.
Reasoning: Tests the governing mechanism.
Common incorrect answer: BigInt is just a larger Number and can freely mix in arithmetic.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 21
Q146 — Debug a bug involving BigInt interoperability.
Level: Intermediate
Category: BigInt interoperability
Expected answer: Apply this rule first: BigInt supports integer arithmetic of arbitrary magnitude but cannot be mixed directly with Number arithmetic; comparison has specific interoperability rules and JSON needs an explicit strategy.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: BigInt is just a larger Number and can freely mix in arithmetic.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 21
Q147 — Name the misconception about BigInt interoperability.
Level: Intermediate
Category: BigInt interoperability
Expected answer: Correct model: BigInt supports integer arithmetic of arbitrary magnitude but cannot be mixed directly with Number arithmetic; comparison has specific interoperability rules and JSON needs an explicit strategy.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: BigInt is just a larger Number and can freely mix in arithmetic.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 21
Q148 — What production decision follows from BigInt interoperability?
Level: Intermediate
Category: BigInt interoperability
Expected answer: Use this constraint: BigInt supports integer arithmetic of arbitrary magnitude but cannot be mixed directly with Number arithmetic; comparison has specific interoperability rules and JSON needs an explicit strategy.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: BigInt is just a larger Number and can freely mix in arithmetic.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 21
Q149 — Define Date pitfalls precisely.
Level: Intermediate
Category: Date pitfalls
Expected answer: `Date` represents a timestamp while getters/parsing/formatting may involve local time or UTC; DST/time-zone assumptions make calendar arithmetic error-prone.
Reasoning: Tests the governing mechanism.
Common incorrect answer: A Date object stores the user's time zone together with the timestamp.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 22
Q150 — Debug a bug involving Date pitfalls.
Level: Intermediate
Category: Date pitfalls
Expected answer: Apply this rule first: `Date` represents a timestamp while getters/parsing/formatting may involve local time or UTC; DST/time-zone assumptions make calendar arithmetic error-prone.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: A Date object stores the user's time zone together with the timestamp.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 22
Q151 — Name the misconception about Date pitfalls.
Level: Advanced
Category: Date pitfalls
Expected answer: Correct model: `Date` represents a timestamp while getters/parsing/formatting may involve local time or UTC; DST/time-zone assumptions make calendar arithmetic error-prone.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: A Date object stores the user's time zone together with the timestamp.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 22
Q152 — What production decision follows from Date pitfalls?
Level: Advanced
Category: Date pitfalls
Expected answer: Use this constraint: `Date` represents a timestamp while getters/parsing/formatting may involve local time or UTC; DST/time-zone assumptions make calendar arithmetic error-prone.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: A Date object stores the user's time zone together with the timestamp.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 22
Q153 — Define Temporal status precisely.
Level: Advanced
Category: Temporal status
Expected answer: Temporal is Stage 4 in the post-ES2026 living work, but runtime/browser support must be checked; specification completion is not universal availability.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Stage 4 means every supported browser already ships the feature.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 23
Q154 — Debug a bug involving Temporal status.
Level: Advanced
Category: Temporal status
Expected answer: Apply this rule first: Temporal is Stage 4 in the post-ES2026 living work, but runtime/browser support must be checked; specification completion is not universal availability.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Stage 4 means every supported browser already ships the feature.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 23
Q155 — Name the misconception about Temporal status.
Level: Advanced
Category: Temporal status
Expected answer: Correct model: Temporal is Stage 4 in the post-ES2026 living work, but runtime/browser support must be checked; specification completion is not universal availability.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Stage 4 means every supported browser already ships the feature.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 23
Q156 — What production decision follows from Temporal status?
Level: Advanced
Category: Temporal status
Expected answer: Use this constraint: Temporal is Stage 4 in the post-ES2026 living work, but runtime/browser support must be checked; specification completion is not universal availability.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Stage 4 means every supported browser already ships the feature.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 23
Q157 — Define RegExp backtracking precisely.
Level: Advanced
Category: RegExp backtracking
Expected answer: Backtracking regex engines can exhibit catastrophic runtime on ambiguous nested quantifiers; constrain patterns, inputs, and use safer formulations to mitigate ReDoS.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Regular expressions always run in linear time.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 24
Q158 — Debug a bug involving RegExp backtracking.
Level: Advanced
Category: RegExp backtracking
Expected answer: Apply this rule first: Backtracking regex engines can exhibit catastrophic runtime on ambiguous nested quantifiers; constrain patterns, inputs, and use safer formulations to mitigate ReDoS.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Regular expressions always run in linear time.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 24
Q159 — Name the misconception about RegExp backtracking.
Level: Advanced
Category: RegExp backtracking
Expected answer: Correct model: Backtracking regex engines can exhibit catastrophic runtime on ambiguous nested quantifiers; constrain patterns, inputs, and use safer formulations to mitigate ReDoS.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Regular expressions always run in linear time.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 24
Q160 — What production decision follows from RegExp backtracking?
Level: Advanced
Category: RegExp backtracking
Expected answer: Use this constraint: Backtracking regex engines can exhibit catastrophic runtime on ambiguous nested quantifiers; constrain patterns, inputs, and use safer formulations to mitigate ReDoS.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Regular expressions always run in linear time.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 24
Q161 — Define symbols precisely.
Level: Advanced
Category: symbols
Expected answer: Symbols are unique primitive property keys; the global registry via `Symbol.for` intentionally shares symbols by string key, while well-known symbols customize language protocols.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Symbols are private properties that reflection can never see.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 25
Q162 — Debug a bug involving symbols.
Level: Advanced
Category: symbols
Expected answer: Apply this rule first: Symbols are unique primitive property keys; the global registry via `Symbol.for` intentionally shares symbols by string key, while well-known symbols customize language protocols.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Symbols are private properties that reflection can never see.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 25
Q163 — Name the misconception about symbols.
Level: Advanced
Category: symbols
Expected answer: Correct model: Symbols are unique primitive property keys; the global registry via `Symbol.for` intentionally shares symbols by string key, while well-known symbols customize language protocols.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Symbols are private properties that reflection can never see.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 25
Q164 — What production decision follows from symbols?
Level: Advanced
Category: symbols
Expected answer: Use this constraint: Symbols are unique primitive property keys; the global registry via `Symbol.for` intentionally shares symbols by string key, while well-known symbols customize language protocols.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Symbols are private properties that reflection can never see.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 25
Q165 — Define Map vs Object precisely.
Level: Advanced
Category: Map vs Object
Expected answer: Map accepts arbitrary key values, has defined insertion-order iteration, a size, and collection-specific APIs; objects are property bags with string/symbol keys and prototypes.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Map is always faster than Object and should replace it everywhere.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 26
Q166 — Debug a bug involving Map vs Object.
Level: Advanced
Category: Map vs Object
Expected answer: Apply this rule first: Map accepts arbitrary key values, has defined insertion-order iteration, a size, and collection-specific APIs; objects are property bags with string/symbol keys and prototypes.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Map is always faster than Object and should replace it everywhere.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 26
Q167 — Name the misconception about Map vs Object.
Level: Advanced
Category: Map vs Object
Expected answer: Correct model: Map accepts arbitrary key values, has defined insertion-order iteration, a size, and collection-specific APIs; objects are property bags with string/symbol keys and prototypes.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Map is always faster than Object and should replace it everywhere.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 26
Q168 — What production decision follows from Map vs Object?
Level: Advanced
Category: Map vs Object
Expected answer: Use this constraint: Map accepts arbitrary key values, has defined insertion-order iteration, a size, and collection-specific APIs; objects are property bags with string/symbol keys and prototypes.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Map is always faster than Object and should replace it everywhere.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 26
Q169 — Define weak collections precisely.
Level: Advanced
Category: weak collections
Expected answer: WeakMap/WeakSet do not keep their object/symbol keys alive solely through the collection and are intentionally non-enumerable because reachability is GC-sensitive.
Reasoning: Tests the governing mechanism.
Common incorrect answer: WeakMap automatically frees values on a deterministic schedule you can observe.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 26
Q170 — Debug a bug involving weak collections.
Level: Advanced
Category: weak collections
Expected answer: Apply this rule first: WeakMap/WeakSet do not keep their object/symbol keys alive solely through the collection and are intentionally non-enumerable because reachability is GC-sensitive.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: WeakMap automatically frees values on a deterministic schedule you can observe.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 26
Q171 — Name the misconception about weak collections.
Level: Advanced
Category: weak collections
Expected answer: Correct model: WeakMap/WeakSet do not keep their object/symbol keys alive solely through the collection and are intentionally non-enumerable because reachability is GC-sensitive.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: WeakMap automatically frees values on a deterministic schedule you can observe.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 26
Q172 — What production decision follows from weak collections?
Level: Advanced
Category: weak collections
Expected answer: Use this constraint: WeakMap/WeakSet do not keep their object/symbol keys alive solely through the collection and are intentionally non-enumerable because reachability is GC-sensitive.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: WeakMap automatically frees values on a deterministic schedule you can observe.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 26
Q173 — Define iterable protocol precisely.
Level: Advanced
Category: iterable protocol
Expected answer: An iterable has `Symbol.iterator` returning an iterator whose `next()` yields `{value, done}`; many syntactic forms consume this protocol and may perform iterator closing.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Any object with a `next()` method is automatically iterable.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 27
Q174 — Debug a bug involving iterable protocol.
Level: Advanced
Category: iterable protocol
Expected answer: Apply this rule first: An iterable has `Symbol.iterator` returning an iterator whose `next()` yields `{value, done}`; many syntactic forms consume this protocol and may perform iterator closing.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Any object with a `next()` method is automatically iterable.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 27
Q175 — Name the misconception about iterable protocol.
Level: Advanced
Category: iterable protocol
Expected answer: Correct model: An iterable has `Symbol.iterator` returning an iterator whose `next()` yields `{value, done}`; many syntactic forms consume this protocol and may perform iterator closing.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Any object with a `next()` method is automatically iterable.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 27
Q176 — What production decision follows from iterable protocol?
Level: Advanced
Category: iterable protocol
Expected answer: Use this constraint: An iterable has `Symbol.iterator` returning an iterator whose `next()` yields `{value, done}`; many syntactic forms consume this protocol and may perform iterator closing.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Any object with a `next()` method is automatically iterable.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 27
Q177 — Define iterator helpers precisely.
Level: Advanced
Category: iterator helpers
Expected answer: Standard Iterator helpers create lazy transformations over iterator sequences; laziness changes allocation and timing, and iterator closing still matters.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Iterator helpers eagerly create arrays like `map` on Array.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 27
Q178 — Debug a bug involving iterator helpers.
Level: Advanced
Category: iterator helpers
Expected answer: Apply this rule first: Standard Iterator helpers create lazy transformations over iterator sequences; laziness changes allocation and timing, and iterator closing still matters.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Iterator helpers eagerly create arrays like `map` on Array.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 27
Q179 — Name the misconception about iterator helpers.
Level: Advanced
Category: iterator helpers
Expected answer: Correct model: Standard Iterator helpers create lazy transformations over iterator sequences; laziness changes allocation and timing, and iterator closing still matters.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Iterator helpers eagerly create arrays like `map` on Array.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 27
Q180 — What production decision follows from iterator helpers?
Level: Advanced
Category: iterator helpers
Expected answer: Use this constraint: Standard Iterator helpers create lazy transformations over iterator sequences; laziness changes allocation and timing, and iterator closing still matters.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Iterator helpers eagerly create arrays like `map` on Array.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 27
Q181 — Define generators precisely.
Level: Advanced
Category: generators
Expected answer: Generator functions return generator objects and suspend/resume around `yield`; `next(value)`, `throw`, and `return` enable bidirectional control and cleanup.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Calling a generator function immediately runs its body to completion.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 28
Q182 — Debug a bug involving generators.
Level: Advanced
Category: generators
Expected answer: Apply this rule first: Generator functions return generator objects and suspend/resume around `yield`; `next(value)`, `throw`, and `return` enable bidirectional control and cleanup.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Calling a generator function immediately runs its body to completion.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 28
Q183 — Name the misconception about generators.
Level: Advanced
Category: generators
Expected answer: Correct model: Generator functions return generator objects and suspend/resume around `yield`; `next(value)`, `throw`, and `return` enable bidirectional control and cleanup.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Calling a generator function immediately runs its body to completion.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 28
Q184 — What production decision follows from generators?
Level: Advanced
Category: generators
Expected answer: Use this constraint: Generator functions return generator objects and suspend/resume around `yield`; `next(value)`, `throw`, and `return` enable bidirectional control and cleanup.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Calling a generator function immediately runs its body to completion.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 28
Q185 — Define typed arrays precisely.
Level: Advanced
Category: typed arrays
Expected answer: TypedArrays are views over binary buffers with fixed element types; byte offsets/lengths and shared underlying buffers make aliasing important.
Reasoning: Tests the governing mechanism.
Common incorrect answer: TypedArrays are normal arrays that merely validate element types.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 29
Q186 — Debug a bug involving typed arrays.
Level: Advanced
Category: typed arrays
Expected answer: Apply this rule first: TypedArrays are views over binary buffers with fixed element types; byte offsets/lengths and shared underlying buffers make aliasing important.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: TypedArrays are normal arrays that merely validate element types.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 29
Q187 — Name the misconception about typed arrays.
Level: Advanced
Category: typed arrays
Expected answer: Correct model: TypedArrays are views over binary buffers with fixed element types; byte offsets/lengths and shared underlying buffers make aliasing important.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: TypedArrays are normal arrays that merely validate element types.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 29
Q188 — What production decision follows from typed arrays?
Level: Advanced
Category: typed arrays
Expected answer: Use this constraint: TypedArrays are views over binary buffers with fixed element types; byte offsets/lengths and shared underlying buffers make aliasing important.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: TypedArrays are normal arrays that merely validate element types.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 29
Q189 — Define SharedArrayBuffer and Atomics precisely.
Level: Advanced
Category: SharedArrayBuffer and Atomics
Expected answer: SharedArrayBuffer permits shared memory across agents; Atomics provides synchronization primitives. Shared memory introduces real data races and should be used only with a protocol.
Reasoning: Tests the governing mechanism.
Common incorrect answer: JavaScript cannot have data races because it is single-threaded.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 30
Q190 — Debug a bug involving SharedArrayBuffer and Atomics.
Level: Advanced
Category: SharedArrayBuffer and Atomics
Expected answer: Apply this rule first: SharedArrayBuffer permits shared memory across agents; Atomics provides synchronization primitives. Shared memory introduces real data races and should be used only with a protocol.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: JavaScript cannot have data races because it is single-threaded.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 30
Q191 — Name the misconception about SharedArrayBuffer and Atomics.
Level: Advanced
Category: SharedArrayBuffer and Atomics
Expected answer: Correct model: SharedArrayBuffer permits shared memory across agents; Atomics provides synchronization primitives. Shared memory introduces real data races and should be used only with a protocol.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: JavaScript cannot have data races because it is single-threaded.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 30
Q192 — What production decision follows from SharedArrayBuffer and Atomics?
Level: Advanced
Category: SharedArrayBuffer and Atomics
Expected answer: Use this constraint: SharedArrayBuffer permits shared memory across agents; Atomics provides synchronization primitives. Shared memory introduces real data races and should be used only with a protocol.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: JavaScript cannot have data races because it is single-threaded.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 30
Q193 — Define Error cause precisely.
Level: Advanced
Category: Error cause
Expected answer: `Error` options can carry `cause` so layers can add context without discarding the original failure; stack traces are implementation/runtime features.
Reasoning: Tests the governing mechanism.
Common incorrect answer: Wrapping an error should replace and discard the original error.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 31
Q194 — Debug a bug involving Error cause.
Level: Advanced
Category: Error cause
Expected answer: Apply this rule first: `Error` options can carry `cause` so layers can add context without discarding the original failure; stack traces are implementation/runtime features.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: Wrapping an error should replace and discard the original error.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 31
Q195 — Name the misconception about Error cause.
Level: Advanced
Category: Error cause
Expected answer: Correct model: `Error` options can carry `cause` so layers can add context without discarding the original failure; stack traces are implementation/runtime features.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: Wrapping an error should replace and discard the original error.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 31
Q196 — What production decision follows from Error cause?
Level: Advanced
Category: Error cause
Expected answer: Use this constraint: `Error` options can carry `cause` so layers can add context without discarding the original failure; stack traces are implementation/runtime features.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: Wrapping an error should replace and discard the original error.
Follow-up: How would you regression-test it?
Related handbook chapter: chapter 31
Q197 — Define Promise settlement precisely.
Level: Advanced
Category: Promise settlement
Expected answer: A Promise is pending then fulfilled or rejected; settlement is one-way, while resolution can adopt another thenable's eventual state.
Reasoning: Tests the governing mechanism.
Common incorrect answer: A resolved promise is necessarily already fulfilled.
Follow-up: Give one minimal example.
Related handbook chapter: chapter 32
Q198 — Debug a bug involving Promise settlement.
Level: Advanced
Category: Promise settlement
Expected answer: Apply this rule first: A Promise is pending then fulfilled or rejected; settlement is one-way, while resolution can adopt another thenable's eventual state.
Reasoning: Tests mechanism-first debugging.
Common incorrect answer: A resolved promise is necessarily already fulfilled.
Follow-up: What evidence would change your hypothesis?
Related handbook chapter: chapter 32
Q199 — Name the misconception about Promise settlement.
Level: Advanced
Category: Promise settlement
Expected answer: Correct model: A Promise is pending then fulfilled or rejected; settlement is one-way, while resolution can adopt another thenable's eventual state.
Reasoning: Tests guarantee vs folklore.
Common incorrect answer: A resolved promise is necessarily already fulfilled.
Follow-up: What bug can the misconception cause?
Related handbook chapter: chapter 32
Q200 — What production decision follows from Promise settlement?
Level: Advanced
Category: Promise settlement
Expected answer: Use this constraint: A Promise is pending then fulfilled or rejected; settlement is one-way, while resolution can adopt another thenable's eventual state.
Reasoning: Tests turning semantics into contracts.
Common incorrect answer: A resolved promise is necessarily already fulfilled.