While doing some exercises on JavaScript ES6+ I came across a syntax I did not understand. In the below code, how come the length property in
{name:{length:l}}
is not prefixed by the object and a DOT? I'm used to seeing the length property used like this: str.length;
Note: I'm using console.log just to see the values.
const bob = { name: 'Bob' };
const alice = { name: 'Alice' };
const foundAt = [bob, alice].findIndex(({ name: { length: l } }) => console.log(l))