JavaScript foreach
const avengers = ['thor', 'captain america', 'hulk'];
avengers.forEach((item, index)=>{
console.log(index, item)
})
connect.sonveer
const avengers = ['thor', 'captain america', 'hulk'];
avengers.forEach((item, index)=>{
console.log(index, item)
})
users.forEach((user, index)=>{
console.log(index); // Prints the index at which the loop is currently at
});
const array1 = ['a', 'b', 'c'];
array1.forEach(element => console.log(element));
const Gpio = require('../onoff').Gpio;
const led = new Gpio(17, 'out');