I have the following object:
let obj = {
"name": "someName",
"age": 33,
"city": "someCity"
}
I understand that an object is not indexed
"JS objects have no defined order, they are (by definition) an unsorted set of key-value pairs."
so what is the complexity of:
let result = obj.name
Is it searching all over the object to find the right key? Is there a way to index this object so complexity will be O(1)?