Values, names and types
1.[2p] Why does 0.1 + 0.2 === 0.3 evaluate to false?
Why does 0.1 + 0.2 === 0.3 evaluate to false?
2.[2p] What string does typeof null return? Write it without quotes.
What string does typeof null return? Write it without quotes.
3.[2p] "5" - 3 evaluates to the number 2, while "5" + 3 evaluates to the string "53". Why do the two coerce in opposite directions?
"5" - 3 evaluates to the number 2, while "5" + 3 evaluates to the string "53". Why do the two coerce in opposite directions?
4.[2p] What does 1 + 2 + "3" evaluate to? Write the result without quotes.
What does 1 + 2 + "3" evaluate to? Write the result without quotes.
5.[1p] NaN === NaN evaluates to false, which is why Number.isNaN(x) exists.
NaN === NaN evaluates to false, which is why Number.isNaN(x) exists.
6.[2p] What does 2 ** 10 % 100 evaluate to?
What does 2 ** 10 % 100 evaluate to?
7.[2p] Which of these are true of const?
Which of these are true of const?
Select all that apply
8.[2p] Put these steps in the order the machine performs them when running count = count + 1.
Put these steps in the order the machine performs them when running count = count + 1.
Add 1 to that value
Look up the value currently held by
countBind the name
countto that result
Show the answer
b, c, a
9.[3p] Match each expression to the value it produces.
Match each expression to the value it produces.
7 / 2
"2" + "3"
Number("abc")
1 / 0
"hello".length
5
3.5
NaN
Infinity
the string "23"
Show the answer
7 / 2: 3.5 "2" + "3": the string "23" Number("abc"): NaN 1 / 0: Infinity "hello".length: 5