0

I have a map in JavaScript. When I check to see if an array is in the map, it returns false even though it is clearly in it. Here is the code:

var map = new Map([[[1, 2], 4]]);
for (let key of map.keys()) {
  console.log(key)
}
console.log(map.has([1, 2]))

Why does the .has method not work with arrays?

2

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.