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 Multiple Items with Arrays Create an Array


Challenge Task 1 of 2

Create an array named data and store any 3 numbers in it. Bummer! I don't see 3 numbers in the array

what am i doing wrong?

var data = ['1','2','3']
<!DOCTYPE html>
  <meta charset="utf-8">
  <title>JavaScript Loops</title>
<script src="script.js"></script>

2 Answers

Abe Layee
Abe Layee
8,378 Points

By adding quotation around the number, it becomes a string. Get rid of the quotation from around the number like this. Check this is out for more information https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array

var data = [1,2,3]

I saw the issue and i fixed it can you help me with Challenge 2?

Ryan Field
Ryan Field
Courses Plus Student 21,241 Points

Challenge 2 is very similar to the first one. What specifically don't you understand?

For challenge 2 you just need to create one item as a string, one as a number, and one as a boolean value. You have already done the first two, so it should be fairly straightforward.