Caution: question still applies to for…of loops.> Don\'t use for…in to iterate over an Array, use it
question still applies to for…of loops.> Don\'t use for…in to iterate over an Array, use it
for…of
for…in
Answer Given by rushUp Is correct but this will be more convenient
for (let [index, val] of array.entries() || []) { // your code goes here }