Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js create array from for loop

var yearStart = 2000;
var yearEnd = 2040;

var arr = [];

for (var i = yearStart; i < yearEnd+1; i++) {
    arr.push(i);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #create #array #loop
ADD COMMENT
Topic
Name
3+3 =