David Bruant (2014-03-23T18:37:30.000Z)
Le 23/03/2014 19:24, Brendan Eich a écrit :
> Marcus Stade wrote:
>> This is assuming that the `current` or `prev` property is indeed 
>> implemented by the engine and not user land, as that indeed both 
>> carries implementation cost and the risk out running out of sync. Is 
>> there any way other than generator functions to implement iterators? 
>> Are any ol' object with a function called `next` an iterator?
>
> Any old object. It's a structural or "duck-typed" protocol.
Longer form at :
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol 
(reviews welcome)

David
domenic at domenicdenicola.com (2014-03-26T23:20:47.240Z)
Le 23/03/2014 19:24, Brendan Eich a écrit :

> Any old object. It's a structural or "duck-typed" protocol.

Longer form at :
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol 
(reviews welcome)