JavaScript objects are actually hash tables under the hood. (See https://en.wikipedia.org/wiki/Hash_table for more info on how hash tables work.)
In simple terms, in a hash table, the key itself directly correlates to a number when put through the hash table's hashing function, which number is (or correlates to) an address. Thus, JavaScript can (typically) directly use the key name to access that number and/or address. This has runtime complexity O(1) because the key's string (if it's a string) can be decoded into an address without any iteration over the other keys in the object.