I’m working on one of the intermediate algorithm scripting tasks in the Data Structures course and I can’t for the life of me get Javascript to iterate over the objects in an array passed to a function. It always iterates over the array indices.
For example, if I type:
for(let obj in collection) {
console.log(obj)
}
the output is always
0
1
2
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0
Challenge: Intermediate Algorithm Scripting - Wherefore art thou