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.

script.js
var data = [ 1, 1, 1 ];

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

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.