My first impression is the same as yours
But after I realised the implementation, everything will be correct
if you use table[key], there is no way to detect if an element already exists in the object, especially you are using UUID for the key part
but the solution is to use the hash of that object as the UUID and the key, so you can have everything unique(the same element will give same hash), but still can add "infinite amount" of element without implementing your key generator
the code example is just an example
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
So why not directly use table[key] = value?
My first impression is the same as yours
But after I realised the implementation, everything will be correct
if you use table[key], there is no way to detect if an element already exists in the object, especially you are using UUID for the key part
but the solution is to use the hash of that object as the UUID and the key, so you can have everything unique(the same element will give same hash), but still can add "infinite amount" of element without implementing your key generator
the code example is just an example