JavaScript constructor 屬性
實例
返回fruits數(shù)組對象原型創(chuàng)建的函數(shù):
fruits.constructor;
結果輸出:
function Array() { [native code] }
嘗試一下 ?
定義和用法
constructor 屬性返回對創(chuàng)建此對象的數(shù)組函數(shù)的引用。
Browser Support
所有主要瀏覽器都支持constructor屬性。
語法
array.constructor
技術細節(jié)
返回值: | 一個函數(shù)對象。該函數(shù)由數(shù)組對象的原始創(chuàng)建。 |
---|---|
JavaScript 版本: | 1.1 |

更多建議: