JavaScript · Junior · Question 72 of 75

What happens with JSON.parse("{ name: 'Ann' }")?

Explanation

JSON is stricter than JS object literals: no single quotes, no trailing commas, no comments. Wrap parsing of untrusted data in try/catch.

Further reading

Problem with a question

JavaScript · Junior · question 72

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