要用 if(val!=undefined) 不能用 if(!val) 因为如果这个值是0的话后面这个用法会有问题 要用 if (val != undefined) 不能用 if (!val) 因为如果这个值是0的话后面这个用法会有问题