Using Array objects as key for ES6 Map
Understand that ES2015 Map keys are compared (almost) as if with the === operator. Two array instances, even if they contain the same values, do not ever compare as === to each other. Try this: var a = new Map(), key = [‘x’, ‘y’]; a.set(key, 1); console.log(a.get(key)); Since the Map class is intended to be … Read more