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

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?

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

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,238 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.