constructor 屬性返回對創(chuàng)建此對象的數(shù)組函數(shù)的引用。 語法 object.constructor constructor,構(gòu)造函數(shù),對這個名字,我們都不陌生,constructor始終指向創(chuàng)建當(dāng)前對象的構(gòu)造函數(shù)。 這里有一點需要注意的是,每個函數(shù)都有一個prototype屬性,這個prototype的constructor指向這個函數(shù),這個時候我們修改這個函數(shù)的prototype時,就發(fā)生了意外。
www.dbjr.com.cn/article/826...htm 2025-5-23