在js裏總遇到判斷傳參是否爲空的情況,但是js裏面通過obj==null判斷好像作用不明顯,
不過通過“!”判斷,事半功倍。做個小計
function replace_null(str){
if(!str){
//alert('null');
document.write('0');
}else{
document.write(str);
}
}
在js裏總遇到判斷傳參是否爲空的情況,但是js裏面通過obj==null判斷好像作用不明顯,
不過通過“!”判斷,事半功倍。做個小計
function replace_null(str){
if(!str){
//alert('null');
document.write('0');
}else{
document.write(str);
}
}