Objects are arrays in JavaScript? I have difficulty understanding how this is possible:
var obj = {
title: 'some value'
}
console.log(obj['title']); // some value
In my conception the use of brackets is only possible in lists to pass a direct index or have an incremental variable to go through all the objects.
How is this possible? When I access ['title'] does it go through all the keys ( Object.keys
) of the object until it finds the requested key or goes straight to the index? >