- script.js
JavaScript
var usersByDay = [4, 2, 1, 3];
console.log(usersByDay);
Result
Goalscompleted
- At the end of the program, add a variable
currentIndex
with a zero value. - Then add a loop that increases the variable
j
from the valuecurrentIndex + 1
tousersByDay.length - 1
inclusively. Value ofj
must increase by one after each iteration. - Inside the loop, log the value of the j-th element of the array in the console.
Comments