durch Array JS iterieren
var arr = ["f", "o", "o", "b", "a", "r"];
for(var i in arr){
console.log(arr[i]);
}
FlashingMustard
var arr = ["f", "o", "o", "b", "a", "r"];
for(var i in arr){
console.log(arr[i]);
}
var txt = "";
var numbers = [45, 4, 9, 16, 25];
numbers.forEach(function(value, index, array) {
txt = txt + value + "<br>";
});
let array = ['Item 1', 'Item 2', 'Item 3'];
for (let item of array) {
console.log(item);
}
/* ES6 */
const cities = ["Chicago", "New York", "Los Angeles"];
cities.map(city => {
console.log(city)
})
var myStringArray = ["Hello","World"];
var arrayLength = myStringArray.length;
for (var i = 0; i < arrayLength; i++) {
console.log(myStringArray[i]);aegweg
//Do something
}
let Hello = ['Hi', 'Hello', 'Hey'];
for(let i = 0; i < Hello.length; i++) {
console.log(Hello[i]); // -> Hi Hello Hey
}