var a = "" || 0; // a is set to 0 because "" is empty and is false
var b = "non-empty" || 0 // b is set to "non-empty" because it's not an empty string
于 2013-01-18T19:56:53.260 回答
This answer is useful
0
如果 id='name' 的 dom 元素的 HTML 内容不为空,它将添加到文本数组,否则将添加 0