简体   繁体   English

理解Javascript中的双括号操作

[英]Undestanding double bracket operation in Javascript

What does [1,2,3][1,2] means in Javascript? [1,2,3][1,2] 在 Javascript 中是什么意思? I do not understand what its supposed to do, and i have no clue how could i google such thing.我不明白它应该做什么,我不知道我怎么能用谷歌搜索这样的东西。

Any ideas?有任何想法吗?

I assume this is quite the newbie question, please forgive my ignorance.我认为这是新手问题,请原谅我的无知。

So the [1,2,3][1,2] as a whole accesses the index 2 of the array, and yields 3 .所以[1,2,3][1,2]作为一个整体访问数组的索引2 ,并产生3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM