for in javascript example
Example 1: javascript for loop
for (var i; i < 10; i++) {
}
Example 2: loop javascript
for(let i = 1; i > 0; i++) {
}
Example 3: for in loop javascript
let array = [1,2,3,4,5,6,7,8,9,10];
for (let i = 0; i < array.length; i++) {
console.log(array[i]);
}
Example 4: for in loop javascript
var person = {"name":"taylor","age":31};
for (property in person) {
console.log(property,person[property]);
}
Example 5: for javascipt
for (let i = 0; i < 9; i++) {
str = str + i;
}
Example 6: javascript for of
const numbers = [1,2,3,4];
for(const item of numbers){
console.log(item);
}