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
Seth Warner
5,348 PointsWhats wrong with my code?
The newYork variable contains an object, but the population is wrong. Add a line of code that sets the population property to 8.406e6. Don't change the original declaration of the object.
var newYork = {
population: 100,
latitude: '40.7127 N',
longitude: '74.0059 W'
};
newYork.population = 8.406e6
newYork.country = USA
I can't click the "get help" button in the quiz for some reason.
Seth
4 Answers
Tobias Helmrich
31,604 PointsHey Seth,
you almost got it right but the value of the country property should be a string and you didn't put it in quotes.
So it should look like this:
var newYork = {
population: 100,
latitude: '40.7127 N',
longitude: '74.0059 W'
};
newYork.population = 8.406e6;
newYork.country = 'USA';
Seth Warner
5,348 PointsTobias Helmrich I laughed SO hard and felt SO dumb when I read this, thank you SOOO much man!
Seth
James Bradd
4,597 PointsI find that's the majority of my troubleshooting. Spent two hours once to figure out I misspelled "walking" as "waking" in a package name. This is the benefit of having fresh eyes look at your code!
Seth Warner
5,348 PointsOh funny how the little things in code make the biggest problems James Bradd
Tobias Helmrich
31,604 PointsHaha, no problem! I agree with James, it happened to me so many times before that some small mistake broke my whole code but I had a tunnel vision and didn't notice it and I felt so stupid afterwards. But I guess that's just a part of coding. :)
Seth Warner
5,348 PointsTobias Helmrich lol Indeed! One major attribute that seems to make a good programmer is lots and lots of "Suffering". xD
Alicia Taylor
4,788 PointsYou are assigning a new value that is a string (hint).