es6的类
01-判断数据类型的方法
# typeof: 只能用来判断基本数据类型
typeof '123' 'string'
typeof 123 'number'
typeof null 'object'
typeof [1,2,3] 'object'
typeof {
uname: '小妲己'} 'object'
typeof function() {
} 'function'
# constructor构造器
// 原理:实例对象本身是没有constructor属性的,但是可以根据原型链关系,实例对象可以使用构造函数的原型对象上的constructor构造器
// 不能判断undefined和null
[1,2,3].construtor // Array
{