modern js loop code example
Example 1: modern javascript for loop syntax
let friends=["jony","tom","Tejas"];
for(elements of friends){
console.log(elements);
}
Example 2: what is the modern syntax for iterating through array using for loop in javascript
let friends=["jony","tom","Tejas"];
friends.forEach(
function f(i){
console.log(i);
}
)