ES6 iterator support
maxhoffmann opened this issue · comments
Max Hoffmann commented
In the readme it says:
All Mori collections support ES6 iteration via foo[Symbol.iterator] or foo["@@iterator"].
Array.from(mori.vector(1,2,3))
does not work though. Is there any documentation about this?
Jichao Ouyang commented
maybe Array.from is Firefox only thing
it does work
var iterator = mori.vector(1,2,3)[Symbol.iterator]()
iterator.next()
// => { done: false, value: 1 }
Eric Gjertsen commented
It doesn't work for me (mori v0.3.2, Chrome 43) --
var iterator = mori.vector(1,2,3)[Symbol.iterator]
// => undefined
var iterator = mori.vector(1,2,3)["@@iterator"]
// => undefined