为什么将地图称为地图?
我一直在使用地图 method in Java and JavaScript for a while now, and every time I use it I wonder why was it named "地图". It wasn't obvious to me how the name corresponded to the actual functionality.
因此,我去了我最喜欢的研究网站twitter.com(lol),并询问了社区。
I 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
在几分钟之内,我收到了精彩的回复,突然之间,一切都变得有意义了!
与数据结构无关地图我一生都在用。 这是一个数学术语!
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)甚至很友善,让我知道我并不是完全不知道这一点。
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
亲朋好友! 希望这对您来说也是一个“ TIL”时刻。
from: https://dev.to//techgirl1908/why-is-map-called-map-2l03