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

confuse

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

script.js
var data [ 2, 3, 4];
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

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