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


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,260 Points

You are missing the assigment operator

var data = [ 2, 3, 4];

That way you assign an array to the variable data