How does Javascript traverse a map vs traversing an array to lookup items? [closed]

Lets take a look at two statements

//case 1
let someMap1 = [];
someMap1.push({someObj});
const someObjIndex = arr.length -1;

//case 2
let someMap2 = {}
someMap2.someObj = {someObj}
//alternatively
someMap[someObj] = {someObj}

Now if I wanted to access someObj I can use the following commands

const someObjtoAccessFromArray = someMap1[someObjIndex]
const someObjToAccessFromMap = someMap2[someObj];

In case 1 the computer will go counting upto the length of array and find the someObj if within bounds. But how does it behave in the second case?

My question is since the two functions are doing the same thing are there any pros and cons in the two different approaches and how computationally intense are the two statements in terms of execution in terms of memory and speed?