Function.prototype.before = function(beforeFn) {
var slef = this;
console.log(this);
return function() {
console.log(this);
beforeFn.apply(this, arguments);
return slef.apply(this, arguments)
}
};
Function.prototype.after = function(afterFn) {
var self = this;
return function() {
var res = self.apply(this, arguments);
afterFn.apply(this, arguments);
return res;
}
};