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

Seth Pabst
Seth Pabst
7,711 Points

Why won't this work?

Unexpected token?

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

1 Answer

Steven Parker
Steven Parker
180,120 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.