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 trialCharlotte Zhang
4,425 PointsWhy it is telling me Task 1 is no longer passing?
Don't know why, I tried at least five times, it just keep telling me task one (creating a literal array named coordinates) is no longer passing, did I do something wrong?
var coordinates = [
[thing1, thing2]
];
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Objects</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
3 Answers
Mohammed AlShaiban
6,455 PointsYou were asked to create an empty two-dimensional array, however, you added "thing1" and "thing2" to it and since it is not empty, it will not pass.
Here is how to create an empty two-dimensional array
var coordinates = [[],[]];
Mohammed AlShaiban
6,455 PointsIf your issue was with task two, you can just add the elements to the array like this
var coordinates = [[],[]];
coordinates[0][0] = 'thing1';
coordinates[0][1] = 'thing2';
instead of directly adding it to the array like what you did above
var coordinates = [
[thing1, thing2]
];
Steven Parker
231,269 PointsCongratulations on resolving your issue.
But to answer your original question, the challenge always re-tests the previous tasks in order. And if you've introduced a syntax error (such as the reference to non-existent variables), that will invalidate the whole script. So the tester will report that as "Task 1 is no longer passing".
Charlotte Zhang
4,425 PointsCharlotte Zhang
4,425 PointsThat's not the issue, but never mind, I fixed it, I failed to put "" around a string. Thanks for the quick response!