flatMap Can Filter AND Transform?!

flatMap is a SECRET WEAPON! Return empty array to REMOVE items, return array with value to KEEP. One pass does filter AND map together! This trick will make your code 10x cleaner!

#javascript #javascripttricks #flatmap #arrayfilter #arraytransformation #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascripttips #functionalprogramming #advancedjavascript

https://www.youtube.com/watch?v=b3SGNML931E

flatMap Can Filter AND Transform?! #JavaScript

YouTube
Chaining Optionals using flatMap and map http://steinar.bang.priv.no/?p=461 #java_programming #flatmap #functional_programming #java #java8 #map #optional #orelse #programming The blog post How I learnt to like Optional shows an example of how to chain Optional values safely, using Optional.orElse() to provide empty objects for the next level in the chain. This blog post uses Optional.flatMap() and Optional.map(), to achieve the same thing, without having to create the empty objects, and withou
Chaining Optionals using flatMap and map

Steinar Bangs blogg