含蓄芝麻

文章
2
资源
0
加入时间
3年0月21天

js 判断是否为null(非空)

在js里总遇到判断传参是否为空的情况,但是js里面通过obj==null判断好像作用不明显,不过通过“!”判断,事半功倍。做个小计function replace_null(str){ if(!str){  //alert('null');  document.write('0'); }else{  document.write(str); }}...