Here is a simple example.
let obj = {
arr: [11, 22, 33]
}
let first = obj[0]; // just want to get the first value of obj.arr;
Is there any way to intercept the method that []
is actually executing, so that I can return the value I want?
Here is a simple example.
let obj = {
arr: [11, 22, 33]
}
let first = obj[0]; // just want to get the first value of obj.arr;
Is there any way to intercept the method that []
is actually executing, so that I can return the value I want?