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: using delegate I var Exciting JavaScript - Part I


Published on

OOP: using delegate I
var a = {
hello: function(){ console.log(“Hello!”); },
zen: function(){ console.log(“O-O-OM”); }
a.hello(); // Hello!
var b = delegate(a);
b.hello(); // Hello!
b.hello = function(){ console.log(“Huh?”); };
a.hello(); // Hello!
b.hello(); // Huh?


Published in: Technology