Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

ellie adam
26,377 Pointsstage 2 cmd line
var jsonString = '{"name": "Andrew", "languages": ["javascript", "swift", "java", "ruby", "html", "css", "qbasic"]}'; var jsonObject = JSON.parse(jsonString);
var jsonString = '{"name": "Andrew", "languages":
["javascript", "swift", "java", "ruby", "html", "css", "qbasic"]}';
var jsonObject = JSON.parse(jsonString);
4 Answers

Salman Akram
Courses Plus Student 40,065 PointsHi Ellie,
You need to set one line of var jsonString together, not separate
var jsonString = '{"name": "Andrew", "languages": ["javascript", "swift", "java", "ruby", "html", "css", "qbasic"]}';
var jsonObject = JSON.parse(jsonString);

ellie adam
26,377 Pointshow?

Salman Akram
Courses Plus Student 40,065 PointsWe should leave the first line, you just press enter to go second line to add the second code just like above.
Example:
var var1 = '{"name":...., "languages": [......]}';
var result = JSON.parse(var1);

ellie adam
26,377 PointsI don' t get it. I already have this code.

Mike Burnett
8,429 PointsI think Salman is saying you accidentally inserted a line break in your code, which might be causing the problem. It looks like you may have hit enter after "languages": in order to make the code more readable, but it's causing a problem with JSON.parse().

ellie adam
26,377 Pointsthanks!
ellie adam
26,377 Pointsellie adam
26,377 PointsI tried both string and object. It won't work. var jsonObject = JSON.parse(jsonObject);