js判断变量数据类型typeof、instanceof、Object.prototype.toString.call()、 constructor

JavaScript有4种方法判断变量的类型,分别是typeof、instanceof、Object.prototype.toString.call()(对象原型链判断方法)、 constructor (用于引用数据类型) typeof:常用于判断基本数据类型,对于引用数据类型除了function返
posted @ 2022-09-05 12:50  meetviolet  Views(204)  Comments(0Edit  收藏  举报