corbt / next-frame

Returns a promise that resolves on the next animationFrame
BSD 2-Clause "Simplified" License
167 stars 15 forks source link

Please explain this bit #1

Closed idibidiart closed 8 years ago

idibidiart commented 8 years ago

In Readme,

let recordingsJSON = await response.json();

for (let recording of recordingsJSON) {
... }

Isn't recordingsJSON just a plain object at this point? How is it iterable with for...of ?

Maybe use something like: Object.entries(recordingsJSON)

corbt commented 8 years ago

Yeah, the idea is just that recordingJSON is an iterable array (if it were an object then Object.entries would accomplish the same thing). I've clarified the example a bit to hopefully make that more obvious. Thanks for the question.