JavaScript · Junior · Question 31 of 75

What does JSON.stringify({ a: 1, b: undefined, c: () => 1 }) return?

Explanation

Properties whose values are undefined, functions or symbols are skipped (in arrays they become null). Date becomes a string, Map and Set become {}. Circular references throw an error.

Further reading

Problem with a question

JavaScript · Junior · question 31

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz