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 trialErik Sayce
4,704 PointsMissing a variable declaration in my try block?
I'm struggling with this one, when I run the code I'm getting an error that I'm missing my variable declaration in my try block. I'm new to this so I'm sure it's a simple oversight but I've put a half and hour in trying to figure it out to no avail. Help!!
var jsonString = 'This is not a JSON String';
try {
var jasonObject = JSON.parse(jsonString);
} catch (error){
console.log(error.message);
};
1 Answer
Robert Richey
Courses Plus Student 16,352 PointsHi Erik,
This was tricky. Your variable inside the try block is spelled jasonObject
and needs to be jsonObject
Erik Sayce
4,704 PointsErik Sayce
4,704 Pointsugh I've done this like 12 times but didn't catch it this time around.
thanks!
Andrew Chalkley
Treehouse Guest TeacherAndrew Chalkley
Treehouse Guest TeacherErik Sayce - A second pair of eyes always help.
Jason Seifer and I have a long running joke of saying "JSON not Jason" or was it "Jason not JSON" :)