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