JSClass
12345678910111213141516171819202122232425262728293031323334353637383940414243
null ↑ ↑ __prop__ ↑ |func&obj-|>>prototype>>|proto------------| | Object | |Object.prototype | |---------|<constroctor<|-----------------| ↓ ↘ ↑ ↑ ↑ ↓ ↘ __prop__ ↑ ↑ ↑ ↓ new ↘ ↑ ↑ ↑ ↓ ↘ |obj---| ↑ ↑ ↓ ↘|object| ↑ ↑ >>>>>>>>>>>>>>>>>>>>>>>>>> ↓ |------| ↑ ↑ ↑ ↓ ↓ ↑ ↑ ↑ __prop__ ↓ ↓ __prop__ __prop__ ↑ ↑ ↑ ↓ ↓ ↑ ↑|func&obj-|>>prototype>>|proto-----------------------------| ↑|Function | | Function.prototype | ↑|---------|<constroctor<|----------------------------------| ↑ ↑ ↑ ↑ ↑ ↑ __prop__ __prop__ ↑ ↑ ↑ ↑ ↑ |func&obj-|>>>>prototype>>>|proto---------| ↑ | Bike | |Bike.prototype| ↑ |---------|<<<constroctor<<|--------------| ↑ ↘ ↑ ↑ ↘ __prop__ ↑ ↑ new ↘ ↑ ↑ ↘ |obj-----| ↑ ↘ | bike | ↑ |--------| ↑ ⇡ ↑ __prop__ (extends)= ⇡ ↑ ⇡ |func&obj-|>>>>>prototype>>>>>|proto--------| | Car | |Car.prototype| |---------|<<<<constroctor<<<<|-------------| ↘ ↑ ↘ __prop__ ↑ new ↘ ↑ ↘ |obj-----| ↘ | car | |--------|
123456789101112131415161718192021222324252627282930313233343536373839404142434445
null ↑ ↑ __prop__ ↑ |func&obj-|>>prototype>>|proto------------| | Object | |Object.prototype | |---------|<constroctor<|-----------------| ↓ ↘ ↑ ↑ ↑ ↓ ↘ __prop__ ↑ ↑ ↑ ↓ new ↘ ↑ ↑ ↑ ↓ ↘ |obj---| ↑ ↑ ↓ ↘|object| ↑ ↑ >>>>>>>>>>>>>>>>>>>>>>>>>> ↓ |------| ↑ ↑ ↑ ↓ ↓ ↑ ↑ ↑ __prop__ ↓ ↓ __prop__ __prop__ ↑ ↑ ↑ ↓ ↓ ↑ ↑|func&obj-|>>prototype>>|proto-----------------------------| ↑|Function | | Function.prototype | ↑|---------|<constroctor<|----------------------------------| ↑ ↑ ↑ ↑ __prop__ __prop__ ↑ ↑ ↑ |func&obj-|>>>>prototype>>>|proto---------| | [static]| | | | Bike | |Bike.prototype| |---------|<<<constroctor<<|--------------| ↑ ↘ ↑ ↑ ↑ ↘ __prop__ ↑ ↑ ↑ new ↘ ↑ ↑ ↑ ↘ |obj-----| ↑ ↑ ↘ | bike | ↑ ↑ |--------| ↑ ↑ ⇡ ↑ ↑ __prop__ (extends)= ⇡ ↑ ↑ ⇡ ↑ |func&obj-|>>>prototype>>|proto--------| ↑ | [static]| | | ↑ | Car | |Car.prototype| ↑ |---------|<<constroctor<|-------------| ↑ ↘ ↑ ↑ ↘ __prop__ ↑ super ↑ new ↘ ↑ ↑ ↘ |obj-------------| ↘| car | |----------------|
car instanceof Car: car.__prop__ === Car.prototype
car instanceof Car
car.__prop__ === Car.prototype
本文采用 CC BY-NC-SA 3.0 Unported 协议进行许可