1. “” == false
空字符的类型转换
空字符的类型转换
总结:如果为空的话,我们可以这么写:
If(!s) {xxxxxxx} 等同于 (s == ‘') {xxxxxxx}
If(s) {xxxx}        等同于if(s !== ‘') {xxxxxxx}

相关文章: