I know that looking up a hash value by key is O(1) (constant time) but is it the same if you find the key that has a certain value? I'm looking up the key using:
const answer = Object.keys(dict).find(key => dict[key] === 1);
dict is an object that has integer keys.