Does anyone knows how to directly call a array key of a Map Object.
As shown in below code, I can map.get(arr), but not map.get([0, 1, 2, 3])
const map = new Map() const arr = [0,1,2,3] map.set(arr, "I am some number") map.get(arr) // "I am some number" map.get([0,1,2,3]) // undefined
map.keys()will return Iterator where you can achieve youarrkey. also you can useforEach, and this is a link to Map descriptionMapand object, and says nothing aboutArray, though. My point was that retrieving from map by iteration will be O(N) just like looking through a list, but with much less overhead.