what does line mean: var DYN
This question already has an answer here:
如果DYN_WEB不为空,它将采用已经为DYN_WEB设置的值,否则为其分配一个空对象。
This is shorthand for
if ( ! DYN_WEB ) {
DYN_WEB = {}
}
or
var DYN_WEB = DYN_WEB ? DYN_WEB : {}
it means if the variable DYN_WEB
has a value which is evaluated to binary true, then keep that value, otherewise assign {}
to it. The latter will happen if the previous value of the variable is 'falsy' ie. one of the false, null, undefined, NaN, 0, "", []
or {}
and in case it's not defined.
上一篇: “意味着在JavaScript数组创建?
下一篇: 线的含义是什么:var DYN