一、typeof
判断返回 的一定是字符串
能判断以下几种:
number、boolean 、string 、undefined、function、 object
二、instanceof
测试一个对象是否属于某种类型
一、typeof
判断返回 的一定是字符串
能判断以下几种:
number、boolean 、string 、undefined、function、 object
二、instanceof
测试一个对象是否属于某种类型
本文标题:typeof 与 instanceof
本文链接:https://www.haomeiwen.com/subject/vjovzttx.html
网友评论