JavaScript Node.js Basics Building a Command Line Application Parsing JSON

Seth Pabst
Seth Pabst
8,608 Points

Why won't this work?

Unexpected token?

const jsonString = '{"name": "Andrew", "languages": ["javascript", "swift", "java", "ruby", "html", "css", "qbasic"]}
const jsonObject = JSON.parse(jsonString);

1 Answer

Steven Parker
Steven Parker
203,162 Points

It looks like the end of the line that was originally provided got truncated. The last two characers (an apostrophe and semicolon) got cut off.

Put them back or start over and be careful not to modify the provided line.