Could someone tell me why:
alert(["a","b","c","d","e"][[1,2],3,4])
o开发者_如何学JAVAutputs e in JavaScript?
Because comma is an operator that executes all of the separated instructions (in fact: two instructions, each of which can also use a comma operator) and returns the results of the last one. I.e.:
["a","b","c","d","e"][[1,2],3,4] => ["a","b","c","d","e"][4] === "e"
精彩评论