使用typeof操作符:typeof返回一个表示值的类型的字符串。
使用instanceof操作符:instanceof用于检查一个对象是都属于某个特定的类型
使用constructor属性:基本数据类型没有constructor属性,而对像属性则有constructor属性指向构造函数。
使用typeof操作符:typeof返回一个表示值的类型的字符串。
使用instanceof操作符:instanceof用于检查一个对象是都属于某个特定的类型
使用constructor属性:基本数据类型没有constructor属性,而对像属性则有constructor属性指向构造函数。