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 an Array

Jayson Camacho
Jayson Camacho
Full Stack JavaScript Techdegree Student 3,006 Points

I don't know where to go from here....

This is what I have so far... var data = [ 1, 1, 1 ];

var assorted = [ var num = 1, var num2 = 2, var answer = num + num2, answer === 3 ];

It ask for a string and a boolean. I don't know if they have to relate? I don't know how to go about formatting a boolean inside of an array.

var data = [ 1, 1, 1 ];

var assorted = [ var num = 1, 
                var num2 = 2,
                var answer = num + num2,
                answer === 3
<!DOCTYPE html>
  <meta charset="utf-8">
  <title>JavaScript Loops</title>
<script src="script.js"></script>

1 Answer

Trevor Johnson
Trevor Johnson
14,427 Points

Hi Jayson, var assorted needs to look like the first array you passed. It is simply an array with three different sorts of inputs, such as a string, a number, and a true or false value. Input it the same way as before, and remove the unnecessary variables that you have within your second array. You will need to do your second array over and think about how you can input those values the same way you created the first array.