JavaScript constructor 属性

 constructor 属性返回对建立此对象的 Date 函数的引用。javascript

var a = new Date()
//undefined
a
//Thu Aug 22 2019 15:17:27 GMT+0800 (中国标准时间)
a.constructor
//ƒ Date() { [native code] }
a.constructor == Array
//false
a.constructor == Boolean
//false
a.constructor == String
//false
相关文章
相关标签/搜索