When filtering isn't enough

If you need to produce another collection, combining filter() and map() is usually the right answer. You can compose your filter() and map() calls using concise and easy to read iteratee functions. When you need to produce a simple value, the reduce() method is there for you.

Manually reducing collections using reduce() requires more implementation effort than either map() and filter(), which is why you should avoid it where possible. Another reason to avoid it is that it can't be executed lazily in a sequence.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.127.232