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
相關文章
相關標籤/搜索