Immutable.js offers methods to break immutable structures into subsets much like Array--for instance it has the all powerful slice()--and unlike Array it offers functional methods like take() and skip(). You get the best of both the imperative and functional worlds.
I am a bit confused, but what's the case of using takeLast(4) with the map if it's unordered? It seems that we can't be sure which 4 will really be returned?
Hi Jan,
Good question. When I recorded these videos I believe Map() didn't have an order "guarantee" but it would stay in order nonetheless, especially for simple operations, which is why those tests pass. But you are right, there isn't a good use case for takeLast(X), so use OrderedMap when you need the guarantee (at the cost of some performance).
have a error for skipWhile, which return size 7 map