- script.js
JavaScript
var usersByDay = [4, 2, 1, 3];
console.log(usersByDay);
Result
GoalsCompleted 0 out of 3
- Remove the entire code for sorting from the second and third elements.
- Then wrap the entire the code after the second line in a loop that increases the variable
currentIndex
from zero tousersByDay.length - 2
inclusively. Value ofcurrentIndex
must increase by one after each iteration. - Inside this loop, remove the duplicate declaration of the variable
currentIndex
.
Comments