javbascript loop through entire array before execution code example
Example: javascript best way to loop through array
var len = arr.length;
while (len--) {
// blah blah
}
var len = arr.length;
while (len--) {
// blah blah
}