loop through elements of array until match 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 loop through array of objects
let arr = [object0, object1, object2];
for (let elm of arr) {
console.log(elm);
}