Counting all items of an (ImmutableJS) Map?

Viewed 3562

Counting the items contained in an object, I used to have:

Object.keys(state.posts).length

Now, I have changed my posts state into an immutablejs Map, like so:

Map({ "1": {title: "First Title"}, "2" : {title: "Second Title"} });

...but now I don't know how to count the items in the object anymore? I tried a few things like Object.keys(state.posts.get()).length and Object.keys(state.posts.entries()).length, but to no avail.

2 Answers
Related