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 JavaScript Loops, Arrays and Objects Tracking Data Using Objects Accessing All of the Properties in an Object

nicole grima
nicole grima
5,028 Points

This is 2nd time I cannot complete a second part of the challenge - same message.

"Oops! It looks like Task 1 is no longer passing" - have you ever encountered this??

script.js
var shanghai = {
  population: 14.35e6,
  longitude: '31.2000 N',
  latitude: '121.5000 E',
  country: 'CHN'
};
index.html
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JavaScript Objects</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>

2 Answers

Tobias Helmrich
Tobias Helmrich
31,602 Points

Hey Nicole,

could you please post the code you wrote in the second task of the challenge?

Here would be a working example to compare your solution:

var shanghai = {
  population: 14.35e6,
  longitude: '31.2000 N',
  latitude: '121.5000 E',
  country: 'CHN'
};

for (var key in shanghai) {
  console.log(key + ": " + shanghai[key]);
}
nicole grima
nicole grima
5,028 Points

Thank you Tobias!! :) That worked!

Tobias Helmrich
Tobias Helmrich
31,602 Points

No problem, I'm glad I could help! :) However don't forget to try to understand the code and find your mistake so you can do it better next time and won't repeat your mistake, good luck! :)

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

When you receive that error message, it means that something in your current code for Task 2 or higher is incorrect and has altered the code in a way that the code checker is no longer to verify your code while checking your current task. It is a quite common (though kind of misleading) error in the challenges. Most times its a simple syntax error (eg. missing an opening or closing bracket, brace, parenthesis, etc), but never has anything to do with Task one.

If you post your code for Task 2, people in the forum will be able to help you trouble shoot where your error is in that task.

:)

nicole grima
nicole grima
5,028 Points

Thank you Jason. Yes I wasn't sure if I had done something wrong in challenge 1 (although I was allowed thru) and get to go fix that or what! haha Super appreciate your prompt help on the matter :)