🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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");
  1. A.truthy
  2. B.falsy
  3. C.false
  4. 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 →