▸case-01 In a JavaScript application, a developer checks if a variable `val` is strictly `null` using `typeof val === 'null'`. Explain why this check fails in JS engines and state what `typeof null` actually evaluates to, along with the correct strict comparison expression. | pass→pass | 7,666 | 14,833 | +93% | 1 | 1 | 0% | 1,469 | 1,960 | +33% | 0 | 0 | — |
▸case-02 Consider the expressions `"10" - 2` and `"10" + 2` in ECMAScript. A developer expects both to perform string concatenation or both to perform numeric subtraction. Explain what each expression evaluates to and why. | pass→pass | 10,306 | 7,465 | -28% | 1 | 1 | 0% | 1,999 | 2,183 | +9% | 0 | 0 | — |
▸case-03 A developer needs to distinguish between `-0` and `+0` in JavaScript financial calculations. They noticed that `-0 === +0` evaluates to `true`. Which built-in JavaScript method uniquely distinguishes `-0` from `+0` without custom helper functions? | pass→pass | 3,889 | 4,724 | +21% | 1 | 1 | 0% | 744 | 1,650 | +122% | 0 | 0 | — |
▸case-04 A developer writes `console.log(x); let x = 5;` inside a function body and expects `x` to evaluate to `undefined` due to hoisting. Explain what actually occurs at runtime and identify the specific temporal zone concept responsible. | pass→pass | 6,946 | 8,583 | +24% | 1 | 1 | 0% | 1,240 | 2,246 | +81% | 0 | 0 | — |
▸case-05 In a browser script, running `for (var i = 0; i < 3; i++) { setTimeout(() => console.log(i), 100); }` prints `3` three times instead of `0, 1, 2`. Explain why this occurs and state the minimal ES6 variable declaration fix without adding function wrappers. | pass→pass | 7,344 | 6,273 | -15% | 1 | 1 | 0% | 1,313 | 1,905 | +45% | 0 | 0 | — |
▸case-06 When executing top-level script code in a standard web browser environment, a developer declares `var a = 1;` and `let b = 2;`. Describe how `a` and `b` differ regarding property attachment on the browser `window` object. | pass→pass | 9,540 | 11,916 | +25% | 1 | 1 | 0% | 1,826 | 2,618 | +43% | 0 | 0 | — |
▸case-07 A recursive JavaScript function lacks a termination base case and runs until engine call limits are reached. What specific native JavaScript Error type is thrown when the call stack capacity is exceeded? | pass→pass | 2,359 | 3,485 | +48% | 1 | 1 | 0% | 378 | 1,297 | +243% | 0 | 0 | — |
▸case-08 Given `function foo() { return 1; }` versus `var bar = function() { return 2; };`, explain why `foo()` can be invoked before its declaration line while calling `bar()` before its assignment line throws an exception. | pass→pass | 10,699 | 8,127 | -24% | 1 | 1 | 0% | 1,618 | 2,258 | +40% | 0 | 0 | — |
▸case-09 An event listener callback inside an object method uses standard `function() { console.log(this.name); }` where `this` evaluates to the event target element instead of the outer object instance. How do ES6 arrow functions resolve this binding issue? | pass→pass | 8,854 | 10,954 | +24% | 1 | 1 | 0% | 1,593 | 2,397 | +50% | 0 | 0 | — |
▸case-10 When `setTimeout(cb, 0)` and `Promise.resolve().then(cb)` are both queued during the execution of a synchronous code block in JavaScript, which callback function executes first in the event loop? | pass→pass | 5,982 | 7,096 | +19% | 1 | 1 | 0% | 1,172 | 2,089 | +78% | 0 | 0 | — |
▸case-11 In traditional asynchronous Node.js style callback pattern `fs.readFile(path, callback)`, what is the standard positional parameter convention for `callback` arguments to signal failure or success? | pass→pass | 4,809 | 3,966 | -18% | 1 | 1 | 0% | 881 | 1,413 | +60% | 0 | 0 | — |
▸case-12 You need to execute three asynchronous operations concurrently in JavaScript. If one operation fails, you still want to collect the full status and values or rejection reasons for all three operations without triggering an unhandled rejection error. Which native Promise static method should be used? | fail→pass | 4,697 | 4,675 | -0% | 1 | 1 | 0% | 840 | 1,608 | +91% | 0 | 0 | — |
▸case-13 Inside an `async` function, an `await` expression targets a rejected Promise, and there is no surrounding `try...catch` block. Explain what happens to the subsequent lines of code inside that `async` function and what state the returned Promise transitions to. | pass→pass | 8,754 | 7,629 | -13% | 1 | 1 | 0% | 1,588 | 2,065 | +30% | 0 | 0 | — |
▸case-14 Define the two criteria that classify a function as a Higher-Order Function in JavaScript according to functional programming principles. | pass→pass | 6,121 | 6,355 | +4% | 1 | 1 | 0% | 1,133 | 1,332 | +18% | 0 | 0 | — |
▸case-15 Consider `function addItem(arr, item) { arr.push(item); return arr; }`. Explain why this function violates pure function principles in JavaScript, and state how to refactor it to be pure. | pass→pass | 7,928 | 6,580 | -17% | 1 | 1 | 0% | 1,453 | 1,924 | +32% | 0 | 0 | — |
▸case-16 What runtime exception occurs when calling `[].reduce((acc, val) => acc + val)` on an empty array in JavaScript without supplying an initial accumulator argument? | pass→pass | 4,001 | 3,688 | -8% | 1 | 1 | 0% | 715 | 1,427 | +100% | 0 | 0 | — |
▸case-17 Given a standard function `add(a, b, c)`, explain how currying converts this function and write the invocation syntax for passing arguments 1, 2, and 3 sequentially to the curried version `curriedAdd`. | pass→pass | 6,464 | 6,149 | -5% | 1 | 1 | 0% | 1,240 | 1,988 | +60% | 0 | 0 | — |
▸case-18 An object `child` is created using `Object.create(parent)`. When code accesses `child.x` and `x` is not an own property of `child`, describe how the JavaScript engine resolves this property lookup. | pass→pass | 10,201 | 9,995 | -2% | 1 | 1 | 0% | 1,881 | 2,609 | +39% | 0 | 0 | — |
▸case-19 You need to lock a JavaScript object so that no new properties can be added and no existing properties can be deleted, while still allowing updates to existing property values. Should you use `Object.freeze` or `Object.seal`? | pass→pass | 4,759 | 4,577 | -4% | 1 | 1 | 0% | 954 | 1,667 | +75% | 0 | 0 | — |
▸case-20 Compare `val ?? 10` and `val || 10` when `val` is numeric `0`. Explain the result of each expression in JavaScript. | pass→pass | 10,213 | 5,389 | -47% | 1 | 1 | 0% | 1,517 | 1,748 | +15% | 0 | 0 | — |
▸case-21 Given a function declaration `function summarize(first, ...rest)`, what object type or data structure does `rest` hold inside the function body when called with `summarize(10, 20, 30)`? | pass→pass | 3,671 | 3,231 | -12% | 1 | 1 | 0% | 516 | 1,297 | +151% | 0 | 0 | — |
▸case-22 In JavaScript ES modules, an `import` statement for a utility function is placed at the bottom of the module file after executable code that calls that utility function. Explain whether this code executes successfully or fails, and why. | pass→pass | 9,529 | 9,108 | -4% | 1 | 1 | 0% | 1,558 | 2,371 | +52% | 0 | 0 | — |
▸case-23 In a web application using standard DOM browser APIs, a developer wants to prevent clicking a form's submit button from refreshing the web page. Should they invoke `event.stopPropagation()` or `event.preventDefault()`, and what does the chosen method do? | pass→pass | 5,720 | 5,162 | -10% | 1 | 1 | 0% | 1,037 | 1,631 | +57% | 0 | 0 | — |
▸case-24 In a Node.js server reading a large file using `fs.createReadStream`, what native stream method should be used to send the stream data to an HTTP response `res` while automatically handling backpressure? | pass→pass | 7,024 | 7,822 | +11% | 1 | 1 | 0% | 1,264 | 2,239 | +77% | 0 | 0 | — |
▸case-25 In a TypeScript codebase, what happens when two `interface` declarations with the identical name `User` are defined within the same module scope? | pass→pass | 8,596 | 8,719 | +1% | 1 | 1 | 0% | 1,530 | 2,285 | +49% | 0 | 0 | — |