<script>
function test(link) {
link = link || 'none';
alert(link);
}
function test2(){
var link = '';
if(link){
alert(1);
}else{
alert(2);//2
}
}
test2();
test('')//弹出none
</script>
if判断空字符串是没有,所以弹出2
if(link=="") 就弹出1