admin管理员组文章数量:1323342
var x = (1,2,3);
alert(x);
This expression evaluates to 3.
How is this expression (1,2,3)
called? Why does it return 3?
var x = (1,2,3);
alert(x);
This expression evaluates to 3.
How is this expression (1,2,3)
called? Why does it return 3?
2 Answers
Reset to default 13Javascript has a ma operator, like C does. It evaluates each of the expressions, then returns the last one.
I haven't seen this in Javascript before. But in a number of other C'ish languages, it basically evaluates each of the expressions in the parentheses and returns the value of the last one.
本文标签: Javascript expression in parenthesesStack Overflow
版权声明:本文标题:Javascript expression in parentheses - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742134906a2422325.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论