var n in loop javascript code example
Example 1: for loop javascript
var listItem = [
{name: 'myName1', gender: 'male'},
{name: 'myName2', gender: 'female'},
{name: 'myName3', gender: 'male'},
{name: 'myName4', gender: 'female'},
]
for (const iterator of listItem) {
console.log(iterator.name+ ' and '+ iterator.gender);
}
Example 2: loop javascript
//this is javascript
var speed = 100;
setInterval(function() {
//DO SOMETHING THAT REPEATS
},speed);