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 trialkristianemil
4,632 PointsCreating an iterable object
I believe this is correct, although the code-challenge-console tells me it can't find the three properties: population, latitude and longtitude.
var paris = {
population : 2.211e6,
latitude : '48.8567 N',
longtitude : '2.3508 E'
};
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Objects</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
2 Answers
andren
28,558 PointsYou have a typo in your in the word longitude, you misspelled it as longtitude (you have an extra t in the middle) if you fix that typo then your code will be accepted.
Steven Ang
41,751 PointsPut double quotes around them.
kristianemil
4,632 PointsNo works man. I've tried double quotes single quotes, around the properties and the values..
andren
28,558 PointsYou don't need to use double quotes to create a string in JavaScript. Single quotes like Kristian is using is valid, and the population
value is a number so using quotes of any kind would technically be wrong.
Steven Ang
41,751 PointsMy fault of not spotting the spelling mistake, and also I'm entirely awarded of the fact that single and double quotes are personal preference in JS. Why I said, that is because maybe for some odd reason, the challenge doesn't accept single quotes so maybe try to put double quotes instead to see whether it function properly.
I tried the challenge, copy paste everything I needed to pass the problem, but I won't let me. So, I tried to replace the single quotes with double quotes, and somehow it worked. That pretty much conclude why I gave that answer.
andren
28,558 PointsAll right I got you, it is true that challenges can at time be pretty picky so it wouldn't be the biggest shock if the type of quote used was the issue. Though in this case the spelling issue was the only problem, once that was fixed the code was accepted even with single quotes being used.
kristianemil
4,632 Pointskristianemil
4,632 Pointsjeez... You're right! Thanks Andren