js判断变量未定义
控制台输出未定义变量a会报错:

我们打印出a的数据类型是:
我们可以看到未定义变量的数据类型是 “undefined”所以判断js变量是否未定义的方法就是 ``` typeof a != "undefined" ? true : false; ```