I just want to understand how javascript ES6 Maps (i.e. let m = new Map()) has 0(1) lookup time. My understanding of ES6 Maps is that its data structure is based on an array of tuples. You can even use an array of tuples in the constructor for Maps. Basically, my questions is:
How is
let t = [[1,'hi'], [2,'bye']]
Different than
let m = new Map([[1,'hi'], [2,'bye']])
The first case would clearly prevent constant lookup. How do ES6 maps achieve constant lookup? What is their underlying data structure?