Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

OOP: delegate • Now we Exciting JavaScript - Part I


Published on

OOP: delegate
• Now we can write a generic delegate:
var delegate = (function(){
function temp(){} // it’ll hold a prototype reference
return function(obj){
temp.prototype = obj; // saving a prototype
var t = new temp(); // new object is delegated
temp.prototype = null; // avoid a memory leak
return t;


Published in: Technology