typeof和instanceof

1.typeof 判断基本的数据类型 主要判断基本的数据类型,我们常用的基本类型有三种,字符串(String),数字(Number),布尔值(Boolean) 一般返回的有:“number”、“string”、“boolean”、“object”、“function” 和 “undefined”。 2.instanceof 运算符用来测试一个对象在其原型链中是否存在一个构造函数的 prototyp
相关文章
相关标签/搜索