Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Iterate with JavaScript For Loops

var myArray = [];
for (var i = 1; i <= 5; i++){
    myArray.push(i);
} 
console.log(myArray) // console output [ 1, 2, 3, 4, 5 ]
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #Iterate #JavaScript #For #Loops
ADD COMMENT
Topic
Name
8+1 =