'Array.find() versus Object.key access

I'm curious how accessing object keys in JavaScript works "under the hood" — when you key an object, does it loop through all of its keys (.find style) until it locates one that matches your accessor? Or does it have some faster way of finding the value corresponding to a key? As an illustration, say you have an object and an array like so:

const arr = ["a","b","c"];
const obj = {"i0":"a","i1":"b","i2":"c"};

In this circumstance, would it be faster to look up obj.i1, or arr.find(a=>a=="b")?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source