String check with if js shorthand
This question already has an answer here:
You can use short-circuiting:
opportunityName && names.push(opportunityName);
The right-hand operand will only be evaluated if the left-hand one is truthy.
链接地址: http://www.djcxy.com/p/27520.html上一篇: 检查输入是否为空
下一篇: 用js速记检查字符串