I've been using the
So, I went to my favorite research site, twitter.com (lol), and asked the community.
Angie JonesI understand what the `map` helper does (for the love of all things good, please don't try to explain this to me) but I've never understood why it's actually called map. That doesn't seem to be a fitting name. This has always nagged at me. Anyone have clear insight?00:57 AM - 31 Dec 2019
Within a matter of minutes, I received wonderful replies and all of a sudden, everything made sense!
It's not some relation to the data structure
Map that I've been using all my life. It's a math term!
Laurie Voss@seldo@techgirl1908 It comes from the mathematical sense of "map", which in turn is drawing an analogy from an actual map of the world. It's a function that relates all the points on one set to another set, the way a geographical map relates points on a piece of paper to points in the world.01:03 AM - 31 Dec 2019
Adeeyo Sulaiman A.@adeeyosulaiman@techgirl1908 "map" comes from Mathematics Set Theory. A map is a function that takes elements of a set (in here, an array) and creates an image set, known as codomain (in here, result array).01:14 AM - 31 Dec 2019
Laurie was even kind enough to let me know I wasn't a total failure for not knowing this.
Laurie Voss@seldo@techgirl1908 This isn't a super helpful term in mathematics to begin with, and adding another hop by taking it to programming makes it even more obscure. I don't think it's a very intuitive word for this action, something like "translate" or "convert" would be more meaningful to me.01:05 AM - 31 Dec 2019
So there you have it folks! Hopefully this was a "TIL" moment for you as well.