【发布时间】:2014-10-06 11:13:45
【问题描述】:
'use strict';
(true, false, 1);
括号是否从多个组成表达式中创建一个表达式?
我以前没见过这种语法。
编辑:引起兴趣的原始代码:
function AddWatermark(controlName, defaultValue, cssValue) {
document.getElementById(controlName).value == ""
&&
(document.getElementById(controlName).value = defaultValue, document.getElementById(controlName).className = cssValue); //I am interested in this syntax on the RHS of the logical AND operator
}
【问题讨论】:
-
那是什么???向我们展示更多细节...只是调用 (true) 没有意义...
-
我怀疑这是一种缩小技术
-
逗号是运算符。
-
我想知道表达式是如何计算的。
-
@C-linkNepal 不,该表达式中没有任何条件
标签: javascript