how to loop through a long array in js in efficient way code example
Example 1: iterate through array javascript
const array = ["one", "two", "three"]
array.forEach(function (item, index) {
console.log(item, index);
});
Example 2: javascript best way to loop through array
var len = arr.length;
while (len--) {
// blah blah
}