← Quiz: Browser Storage and Cookies: all 10 questions
Quiz: Browser Storage and Cookies · Question 4 of 10
What does this print? (code)
What does this print?
console.log(String({ name: "Asha" }));
- A.{"name":"Asha"}
- B.Asha
- C.[object Object]
- D.undefined
Answer & explanation
Correct answer: [object Object]
Without JSON.stringify, an object turns into the text [object Object], which is why localStorage needs JSON for objects.
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 →