- script.js
JavaScript
var usersByDay = [812, 1360, 657, 1247];
Result
Goalscompleted
Let’s get the elements of the array by manually changing the index variable.
- After the array, declare a variable
index
with a zero value. - On the next line, log
usersByDay[index]
in the console. - On the next line, set the variable
index
value3
. - On the next line, once again log
usersByDay[index]
in the console.
Comments