Creating a "method" method on an object
Can someone explain me how they are creating a "method" method on an object.
var foo = {};
foo.method = function(name, cb){
this[name] = cb;
};
lang-js
Can someone explain me how they are creating a "method" method on an object.
var foo = {};
foo.method = function(name, cb){
this[name] = cb;
};