Function.prototype.before = function(fn) {
var _this = this;
console.log(this)
console.log('arguments', arguments)
return function() {
console.log('arguments 2', arguments)
fn.apply(this, arguments);
return _this.apply(this, arguments);
}
}
Function.prototype.after = function(fn) {
var _this = this;
return function() {
var r = _this.apply(this, arguments);
fn.apply(this, arguments);
return r;
}
}
var func_1 = function() {
console.log("2")
}
func_1.before(function(){console.log('a b c')})('cc ')
console