Can for…of be used to iterate over an array in Javascript?
let collection = [{ name: 'music', views: 20 }, { name: 'abc', views: 32 }, { name: 'bob', views: 20 } ] for (const [k, v] of collection) { console.log(k, v) } console.log(Array.isArray(collection)) Error: .for is not iterable Array.isArray(collection) returns…