Home  >  Article  >  Web Front-end  >  一个关于js 定义小括号的问题,高人救我_html/css_WEB-ITnose

一个关于js 定义小括号的问题,高人救我_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:17:121157browse

js 中这么写:var a=("1","2","5",6);
alert(a); 弹出的是6
不知道这么写的语法含义是什么,查了不少资料,没发现类似的用法。求高人指教!谢谢!!!


回复讨论(解决方案)

(,)操作符可以一条语句中进行多个表达式的运算,返回最后表达式的值给变量a

哦,我明白了,谢谢孟子兄!!!

后面是数组 前面是变量值 肯定是服6咯

你可以遍历  each(function(){
});

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn