🔰prototype chain

JSvalueobjectprototype ⟩ chain

the linked series of prototype objects of an object is called it's prototype chain.

從下圖可看出 base classderived class 的連結(繼承)方式,其實是不一樣的:

  • 身為使用者自創的第一個 class,base class AA.prototype 所連接的分別是 Function.prototype Object.prototype

  • derived class BB.prototype 則分別連接 AA.prototype

Last updated