swannodette / mori

ClojureScript's persistent data structures and supporting API from the comfort of vanilla JavaScript

Home Page:http://swannodette.github.io/mori

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ES6 iterator support

maxhoffmann opened this issue · comments

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?

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 }

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