loop array values javascript code example
Example 1: loop through javascript array
let colors = ['red', 'green', 'blue'];
for (const color of colors){
console.log(color);
}
Example 2: iterate through array javascript
foreach ($objects as $obj) {
echo $obj->property;
}