Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript grab only even array index

for(var i = 0; i < a.length; i += 2) {  // take every second element
    ar.push(a[i]);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #grab #array #index
ADD COMMENT
Topic
Name
9+1 =