Immutable-js: How to get all the keys or values of a Map?

Created on 29 Nov 2014  路  2Comments  路  Source: immutable-js/immutable-js

I'm probably just missing something but didn't see this in the docs.

Most helpful comment

map.keys() gives you an iterator of keys.
map.keySeq() a lazy seq (Iterable) of keys.
map.values() iterator of values.
map.valueSeq() a seq of values.

These exist for all collections, not just Map. Full descriptions of each are in the type documentation.

All 2 comments

map.keys() gives you an iterator of keys.
map.keySeq() a lazy seq (Iterable) of keys.
map.values() iterator of values.
map.valueSeq() a seq of values.

These exist for all collections, not just Map. Full descriptions of each are in the type documentation.

Ah, valueSeq is what I wanted. I didn't really get what an iterator was so was confused why toJS wasn't working on it. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

coodoo picture coodoo  路  3Comments

colbyr picture colbyr  路  3Comments

jbonta picture jbonta  路  3Comments

ntgn81 picture ntgn81  路  3Comments

Haroenv picture Haroenv  路  3Comments