Node.js · Junior · Question 70 of 75

What is JSON.parse likely to do with invalid input?

Explanation

When parsing data from files, requests or other services, wrap JSON.parse in try/catch, or the error will crash your handler.

Further reading

Problem with a question

Node.js · Junior · question 70

Test yourself

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

Take this quiz