Vignesh Jayavel

JavaScript Design Patterns - Prototype Pattern (Revised)

JavaScript Design Patterns - Prototype Pattern (Revised)

The revised prototype pattern takes advantage of the Object.create() function introduced in ECMAScript 5. Object.create(objToInherit,optional[propsToAddAndOverride]) provides differential inheritance to JavaScript. So, an object can be created using another object as a prototype. 

 

{ gist vigneshjayavel/9910804 }

{ gist vigneshjayavel/9930099 }