JS tablica dla vs za

let arr = ['el1', 'el2', 'el3'];

arr.addedProp = 'arrProp';

// elKey are the property keys
// (equivalent to an index for an array)
for (let elKey in arr) {
  console.log(elKey); // Will print: 0, 1, 2, addedProp
}

// elValue are the property values
for (let elValue of arr) {
  console.log(elValue) // Will print: el1, el2, el3
}
Vinox Dev