### 判断 js 类型的方式
#### typeof
可以判断出'string','number','boolean','undefined','symbol'
但判断 typeof(null) 时值为 'object'; 判断数组和对象时值均为 'object'
#### instance
```javascript
function A() {}
let a = new A();
a instanceof A //true,因为 Object.getPrototypeOf(a) === A.prototype;
```
#### Object.prototype.toString.call()
常用于判断浏览器内置对象,对于所有基本的数据类型都能进行判断,即使是 null 和 undefined
```javascript
Object.prototype.toString.call(null);//”[object Null]”
Object.prototype.toString.call(undefined);/