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

JavaScript

Whats 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

Hey 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';

Tobias Helmrich I laughed SO hard and felt SO dumb when I read this, thank you SOOO much man!

Seth

I 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!

Oh funny how the little things in code make the biggest problems James Bradd

Haha, 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. :)

Tobias Helmrich lol Indeed! One major attribute that seems to make a good programmer is lots and lots of "Suffering". xD

You are assigning a new value that is a string (hint).