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 trialFroi Nunez
12,133 PointsJavascript Objects, stage 3
It says I should change the population property to a numeric value. I believe I've already done that. Not sure what I've got wrong here. Any suggestions?
var newYork = {
population: 100,
latitude: '40.7127 N',
longitude: '74.0059 W'
};
population = 8.406e6;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Objects</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
2 Answers
Hugo Paz
15,622 PointsHi Froi,
You need to change the value of the object population property. You did not select the object. To set an object property you do something like this : object.property = value
Jacob Mishkin
23,118 Pointsyour really close! what you need to do is add the population change into the object. use the longitude and latitude as a guide to help you. I hope this helps. look at the comma that is used.
Micole Noddle
5,797 PointsI'm stuck on this challenge too. I need a little more help...I think the more I look at it the more I psych myself out! I can't write a code to pass...any additional help would be so greatly appreciated!
Hugo Paz
15,622 PointsHi Micole,
You take the object, choose the property you want to set and assign a value to it.
newYork.population = 8.406e6;
Micole Noddle
5,797 PointsThank you, Hugo! I think I way overthought this one...I kept thinking I had to define it first as a var before I could change it. I really appreciate your help!
Froi Nunez
12,133 PointsFroi Nunez
12,133 PointsThank you!