It's pronounced Diane. I do data architecture, operations, and backend development. In my spare time I maintain Massive.js, a data mapper for Node.js and PostgreSQL.
Obviously this doesn't demonstrate what map and filter do, which is less useful from that perspective! The big deal about it is that it only makes one pass. This doesn't matter much with ten elements but with bigger collections it can save a lot of time.
Also important to note that both
map
andfilter
can be redundant if you're already usingreduce
. Your JavaScript example could be written like this:Obviously this doesn't demonstrate what
map
andfilter
do, which is less useful from that perspective! The big deal about it is that it only makes one pass. This doesn't matter much with ten elements but with bigger collections it can save a lot of time.Totally agree Dian :)
Just to register another way to write the same, I would code like this:
Regards!