Undestanding double bracket operation in Javascript -
what [1,2,3][1,2] means in javascript? not understand supposed do, , have no clue how google such thing.
any ideas?
i assume quite newbie question, please forgive ignorance.
[1,2,3]
array literal<obj>[p]
bracket notation property access1, 2
comma operator expression evaluates2
so [1,2,3][1,2]
whole accesses index 2
of array, , yields 3
.
Comments
Post a Comment