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 trialellie adam
26,377 PointsStage 2 buiding cmd line App
var jsonString = '{"name": "Andrew", "languages": ["javascript", "swift", "java", "ruby", "html", "css", "qbasic"]}'; var jsonObject = JSON.parse(body); console.dir(jsonObject);
I have error
var jsonString = '{"name": "Andrew", "languages": ["javascript", "swift", "java", "ruby", "html", "css", "qbasic"]}'; var jsonObject = JSON.parse(jsonObject);
3 Answers
Chris Shaw
26,676 PointsHi Ellie,
Try removing your console.dir
declaration as it's not required by the challenge.
Happy coding!
ellie adam
26,377 Pointsvar jsonObject = JSON.parse(jsonString);
I fixed the typo. still same error.
Chris Shaw
26,676 PointsYour jsonObject
variable is still wrong, you should be parsing jsonString
.
var jsonObject = JSON.parse(jsonString);
ellie adam
26,377 Pointsvar jsonObject = JSON.parse(jsonString);
Still error. I tried to refresh browser too.
ellie adam
26,377 Pointsellie adam
26,377 Pointsvar jsonString = '{"name": "Andrew", "languages": ["javascript", "swift", "java", "ruby", "html", "css", "qbasic"]}'; var jsonObject = JSON.parse(jsonObject);
I get error again.
Chris Shaw
26,676 PointsChris Shaw
26,676 PointsSorry, I missed the minor typo you also have, instead of
jasonObject
you should havejsonObject
, notice the a no longer the second character, alsobody
should bejsonString
.