use for loop to loop through lisnt js code example
Example 1: javascript loop through array
var colors = ["red","blue","green"];
colors.forEach(function(color) {
console.log(color);
});
Example 2: iterate through array javascript
foreach ($objects as $obj) {
echo $obj->property;
}