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 Multiple Items with Arrays Create a Two Dimensional Array

Julien Arseneau
seal-mask
.a{fill-rule:evenodd;}techdegree
Julien Arseneau
Full Stack JavaScript Techdegree Student 5,200 Points

It tells me that each inner array should have two items in it, but they do.

Why does it say this?

script.js
var coordinates = [[2,3],
                   //here i a the three arrays with 4 arrays in them with 2 items//
                  [ [8,3],[4,4],[3,5],[2,8] ],
                  [ [8,6],[4,6],[2,9],[2,2] ],
                  [ [8,2],[4,1],[3,3],[2,4] ]
                  ]
index.html
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JavaScript Objects</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>

1 Answer

Steven Parker
Steven Parker
228,991 Points

You're working too hard, task 3 only asks you to "Add three more arrays to the coordinates array.". They mean three more like the 1 small one you added in task 2.

What you have now is a three dimensional array, but the challenge is only expecting two.