← Technology quizzes

Free practice quiz

JavaScript Quirks and Coercion

15 questions Technology Grades 9-12

The question sheet

Reveal any answer as you study
  1. Who created JavaScript in 1995?

    • Guido van Rossum
    • James Gosling
    • Tim Berners-Lee
    • Brendan Eich
    Reveal answer

    Answer: Brendan Eich

  2. Which operator is strict equality?

    • =
    • ===
    • ==
    • !=
    Reveal answer

    Answer: ===

  3. The expression 5 == "5" returns true in JavaScript.

    • True
    • False
    Reveal answer

    Answer: True

  4. Converting values from one type to another before comparing is called type ____.

    • binding
    • coercion
    • hoisting
    • casting
    Reveal answer

    Answer: coercion

  5. What does NaN === NaN return?

    • undefined
    • false
    • true
    • NaN
    Reveal answer

    Answer: false

  6. What does the expression 1 + "2" produce?

    • "12"
    • 3
    • -1
    • "3"
    Reveal answer

    Answer: "12"

  7. What does typeof null return?

    • "object"
    • "null"
    • "NaN"
    • "undefined"
    Reveal answer

    Answer: "object"

  8. Moving declarations to the top of their scope is called ____.

    • sorting
    • coercion
    • hoisting
    • casting
    Reveal answer

    Answer: hoisting

  9. let and const were introduced in which version?

    • ES6 (2015)
    • ES2020
    • ES3 (1999)
    • ES5 (2009)
    Reveal answer

    Answer: ES6 (2015)

  10. Variables declared with var are hoisted and given the value null.

    • True
    • False
    Reveal answer

    Answer: False

  11. let and const exist in the "temporal ____ zone" before declaration.

    • dead
    • null
    • empty
    • void
    Reveal answer

    Answer: dead

  12. What does 0.1 + 0.2 produce in JavaScript?

    • 0.3
    • 0.29999999
    • 0.30000000000000004
    • 0.30000001
    Reveal answer

    Answer: 0.30000000000000004

  13. Why does default sort() give odd number order?

    • Random order
    • Sorts as text
    • Sorts descending
    • Ignores duplicates
    Reveal answer

    Answer: Sorts as text

  14. null is loosely equal to undefined but not to zero.

    • True
    • False
    Reveal answer

    Answer: True

  15. Which function checks for NaN?

    • typeof()
    • isFinite()
    • parseInt()
    • Number.isNaN()
    Reveal answer

    Answer: Number.isNaN()

Play the whole quiz inside a game Answers stay hidden while you play

Make your own — free

Turn any notes into a game in under a minute. Free to start.

Make a quiz