← Quiz: Browser Storage and Cookies: all 10 questions
Quiz: Browser Storage and Cookies · Question 3 of 10
What does this print? (code)
What does this print?
const saved = String(false);
console.log(saved ? "truthy" : "falsy");
- A.truthy
- B.falsy
- C.false
- D.undefined
Answer & explanation
Correct answer: truthy
Storage turns false into the string "false", which is non-empty and therefore truthy.
Can you get the rest right without peeking?
Take the timed Quiz: Browser Storage and Cookies quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →