JavaScript Quirks and Coercion
The question sheet
Reveal any answer as you study-
Who created JavaScript in 1995?
- Guido van Rossum
- James Gosling
- Tim Berners-Lee
- Brendan Eich
Reveal answer
Answer: Brendan Eich
-
Which operator is strict equality?
- =
- ===
- ==
- !=
Reveal answer
Answer: ===
-
The expression 5 == "5" returns true in JavaScript.
- True
- False
Reveal answer
Answer: True
-
Converting values from one type to another before comparing is called type ____.
- binding
- coercion
- hoisting
- casting
Reveal answer
Answer: coercion
-
What does NaN === NaN return?
- undefined
- false
- true
- NaN
Reveal answer
Answer: false
-
What does the expression 1 + "2" produce?
- "12"
- 3
- -1
- "3"
Reveal answer
Answer: "12"
-
What does typeof null return?
- "object"
- "null"
- "NaN"
- "undefined"
Reveal answer
Answer: "object"
-
Moving declarations to the top of their scope is called ____.
- sorting
- coercion
- hoisting
- casting
Reveal answer
Answer: hoisting
-
let and const were introduced in which version?
- ES6 (2015)
- ES2020
- ES3 (1999)
- ES5 (2009)
Reveal answer
Answer: ES6 (2015)
-
Variables declared with var are hoisted and given the value null.
- True
- False
Reveal answer
Answer: False
-
let and const exist in the "temporal ____ zone" before declaration.
- dead
- null
- empty
- void
Reveal answer
Answer: dead
-
What does 0.1 + 0.2 produce in JavaScript?
- 0.3
- 0.29999999
- 0.30000000000000004
- 0.30000001
Reveal answer
Answer: 0.30000000000000004
-
Why does default sort() give odd number order?
- Random order
- Sorts as text
- Sorts descending
- Ignores duplicates
Reveal answer
Answer: Sorts as text
-
null is loosely equal to undefined but not to zero.
- True
- False
Reveal answer
Answer: True
-
Which function checks for NaN?
- typeof()
- isFinite()
- parseInt()
- Number.isNaN()
Reveal answer
Answer: Number.isNaN()
Make your own — free
Turn any notes into a game in under a minute. Free to start.