详解js中typeof、instanceof与constructor

it2022-05-05  77

typeof返回一个表达式的数据类型的字符串,返回结果为js基本的数据类型,包括number,boolean,string,object,undefined,function.语法为typeof(data) 或 typeof data

instanceof则为判断一个对象是否为某一数据类型,或一个变量是否为一个对象的实例;返回boolean类型 语法为 o instanceof A

转载于:https://www.cnblogs.com/sencha/p/3268441.html

相关资源:各显卡算力对照表!

最新回复(0)