JavaScript JavaScript Loops, Arrays and Objects Tracking Multiple Items with Arrays Create an Array

Qasim Rashad
Qasim Rashad
Front End Web Development Techdegree Student 7,454 Points


What am I'm doing wrong? I gave it an array named data and gave it three numbers but say error..

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

1 Answer

Jesus Mendoza
Jesus Mendoza
23,266 Points

You are missing the assigment operator

var data = [ 2, 3, 4];

That way you assign an array to the variable data