Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript loop array

if(arr.length<2){
	return false;
}

var arr2 = [];
for(var i=0; i<arr.length; i++){
	if(arr[i] > arr[1]){
		arr2.push(arr[i]);
	}
	else {
		console.log('skipping ', arr[i]);
	}
}
console.log(arr2);
return arr2;
}
Source by www.hackerhero.com #
 
PREVIOUS NEXT
Tagged: #javascript #loop #array
ADD COMMENT
Topic
Name
2+2 =