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 trialAndrew Alvarez
11,964 PointsArray
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>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Loops</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
2 Answers
Abe Layee
8,378 PointsBy 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]
Ryan Field
Courses Plus Student 21,242 PointsYou want to store numbers, not strings.
Andrew Alvarez
11,964 PointsI saw the issue and i fixed it can you help me with Challenge 2?
Ryan Field
Courses Plus Student 21,242 PointsChallenge 2 is very similar to the first one. What specifically don't you understand?
Mike Roberts
7,493 PointsFor 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.