javascript iterate over list code example
Example 1: iterate through list javascript
const array = ["hello", "world"];
for (item of array) {
//DO THIS
}
Example 2: javascript best way to iterate over array
[1,2,3,4,"df"].forEach((value, index) => console.log(index,value));
output
0 1
1 2
2 3
3 4
4 'df'