JavaScript & Prototypal Inheritance
Wednesday, May 27th, 2009I gave a presentation this morning as apart of my Principles of Programming Languages subject on how the basic prototype inheritance in JavaScript can be achieved:
It was restricted to 5 minutes (bah! nothing!) and I practised about 5-7 times to make sure it fit – which it did. I found the most useful segment to illustrate the prototype inheritance chain was via the diagram (second last slide).
The best source I’ve found so far is Douglas Crockford (wrote ‘JavaScript: The Good Parts’). Here he discusses prototypal inheritance.
Due to the 5 minutes constraint I couldn’t deal with Crockford’s beget method or any other techniques or applications of the prototype object. Still the presentation I gave enlightened people I believe.
