<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>js dataType.constructor</title> </head> <body> <script> /*参考: * 1.dataType.constructor 属性返回变量或对象的构造函数。*/ console.log("john".constructor); console.log((3.14).constructor); console.log(false.constructor); console.log([1, 2, 3, 4].constructor); console.log({name: 'john', age: 34}.constructor); console.log(new Date().constructor); console.log(function () { }.constructor); /*ƒ String() { [native code] } ƒ Number() { [native code] } ƒ Boolean() { [native code] } ƒ Array() { [native code] } ƒ Object() { [native code] } ƒ Date() { [native code] } ƒ Function() { [native code] }*/ </script> </body> </html>
js dataType.constructor.html
最新推荐文章于 2022-09-14 16:14:07 发布