Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,704 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 :)