620 likes | 975 Vues
Anything But Typical. Learning to Love JavaScript Prototypes. Dan Nichols March 14 , 2010. JavaScript. Object-Oriented Programming. class. Inheritance. prototype (not the library). The story so far…. <a onclick =“ javascript:alert (‘chaos!’)”>. …except it wasn’t all good.
E N D
Anything But Typical Learning to Love JavaScript Prototypes Dan Nichols March 14, 2010
Property lookup chain instance Date Object
Property lookup chain instance Date Object
Property lookup chain instance Date Object
Property lookup chain instance Date Object
Anatomy of a prototype rex Poodle Dog Object
Anatomy of a prototype Constructor
Anatomy of a prototype Property Method
Anatomy of a prototype Constructor Inheritance
Anatomy of a prototype Instance Instance Property
this and the lookup chain socks fluffy Cat Object
this and the lookup chain socks Cat Object
this and the lookup chain fluffy Cat Object
Execution context with instances Same outcome
Working with inherited behavior LimitedContainer Container Object
Working with inherited behavior LimitedContainer Container Object
Working with inherited behavior LimitedContainer Container Object