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 Access and Set Object Properties

Diego Vogel
Diego Vogel
12,876 Points

*[SOLVED]* "Task 1 no longer passing" - is this a bug?

This is a simple exercise where I'm simply modifying an object property and then adding another a property.

Task 1 is to modify a property by targeting it (as opposed to changing it in the object definition): newYork.population = 8.406e6;

Task 2 is to add a property in a similar manner: newYork.country = USA;

However, when I click "Check Work" for task 2 it says "task 1 is no longer passing" even though I haven't changed anything related to task 1. Very frustrating because I can't continue the course (there's no skip option). Is this a bug?

var newYork = {
  population: 100, 
  latitude: '40.7127 N',
  longitude: '74.0059 W'

newYork.population = 8.406e6;
newYork.country = USA;
<!DOCTYPE html>
  <meta charset="utf-8">
  <title>JavaScript Objects</title>
<script src="script.js"></script>
Diego Vogel
Diego Vogel
12,876 Points

Nevermind, I just needed quotes around "USA". But still, that error message about task 1 no longer passing is confusing.

1 Answer

Jason Anders
Jason Anders
Treehouse Moderator 145,857 Points

Hi Diego,

Very glad you found your error. :thumbsup: I have edited your title to mark as "Solved" for the others in the Community.

I agree, the "Task # is no longer passing" is confusing and very misleading. In the future, if you get this error, don't worry about the previous task it is referencing. This error always means that you have introduced a Syntax Error in the current task being worked on. So, resist the temptation to click "Go to Task #" and just review the current code to find the syntax error (like the missing quotes in this case).
I think this error pops up like that because of the way the Code Checker runs. It runs in sequence, and a syntax error in the current task can interfere with the Checker as it goes through the other tasks. Maybe? :)

Keep Coding! :dizzy: