关于js中没有定义变量判断undefined问题

如果js中没有定义变量,例如js中直接判断

if(a == undefined){

  return false;

}

则会报错a is undfined,要使用typeof(a) == 'undefined'

勘破、放下、自在
原文地址:https://www.cnblogs.com/love-dream-88/p/11257838.html