|
|
|
|
|
by galaxyLogic
1992 days ago
|
|
About map() vs. Map
> Their identical names are just an unfortunate accident of history. No. Their names are clearly NOT identical. Arrays have the method "map()" and there also exists the global class "Map". "Map" !== "map" The fact that they are similarly named is NOT an unfortunate accident of history because yes they are conceptually related. They both are about "mapping" things to other things. So because they are conceptually related one would assume that their names are somewhat similar as well. What is unfortunate I think is that JavaScript Object does not have the method "map()" like Array does. Therefore you can not "map() over Maps" (or Objects in general). |
|