Trying to access object property with many items in square brackets. What is happening behind the scenes?

Viewed 17

I was trying to understand the solution to the problem here.

In the line 39 we try to access there the object propery by differenceAndIndex[i, list[i]]

What is happening when I put more items in the square brackets(like in the example from line 39)?

I made a few test in the console but no idea what it the mechanism behind that.

const object = {
    0: 1,
    a: 2,
    'randomText': 3
}
object['randomText','a',0]
// there is 1 displayed as a result

Seems that the last item in the square brackets [] define the key of an object? What is going on behind the scenes?

0 Answers
Related