โ† All Web Development Flashcard Decks

JavaScript Flashcards

7 cards from real Web Development practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 JavaScript flashcards as text
  1. What does the `typeof` operator return for `null`?

    Answer: 'object'

    `typeof null` returns `'object'` due to a long-standing bug in JavaScript that was never fixed for backwards compatibility.

  2. Which method removes the last element from an array and returns it?

    Answer: pop()

    `Array.prototype.pop()` removes and returns the last element, mutating the original array.

  3. What is the output of `console.log(0.1 + 0.2 === 0.3)` in JavaScript?

    Answer: false

    Floating-point arithmetic in JavaScript produces `0.30000000000000004`, so the strict equality check returns `false`.

  4. What does the `Array.from()` method do?

    Answer: Creates a new Array instance from an array-like or iterable object

    `Array.from()` creates a new array from array-like objects (e.g., NodeLists, strings) or iterables.

  5. What is a closure in JavaScript?

    Answer: A function that retains access to its lexical scope even after the outer function has returned

    A closure is created when an inner function captures and remembers variables from its surrounding scope.

  6. Which statement correctly declares a block-scoped variable in modern JavaScript?

    Answer: let x = 5;

    `let` declares a block-scoped variable, unlike `var` which is function-scoped.

  7. What does `JSON.stringify()` do when it encounters a function value in an object?

    Answer: Omits the key entirely

    `JSON.stringify()` silently omits object properties whose values are functions because JSON has no function type.

How this page was made: written with AI tools. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Not reviewed by a subject-matter expert. Editorial policy