<!DOCTYPE html> <html> <head> <title> </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <script type="text/javascript"> let qq=new Object(); console.log(typeof qq); let arr=new Array(); console.log(typeof arr); console.log(arr.constructor.name); function Person() { this.name = "lnj"; this.age = 34; this.say = function () { console.log(this.name, this.age); } } let p = new Person(); console.log(p.constructor.name); console.log(typeof p); </script> </body> </html>
js中获取对象类型
关注
打赏