typeof和instanceof的作用和区别

typeof的作用 typeof是一元运算符,返回值为字符串,该字符串用来说明运算数的数据类型 用来获取运算数的数据类型。返回的值有number、boolean、undefined、function、object、string number:数字会返回number类型 boolean:boolean值只有true和false undefined:当变量未被声明时会返回undefined,这与var
相关文章
相关标签/搜索