//业务代码,扩大以后的业务代码function say(a, b){ console.log('say', a, b);}// 给某个办法 增加一个办法 在他执行之前调用Function.prototype.before = function(callback) { return (...args)=>{ callback(); this(...args); }}let beforeSay = say.before(function(){ console.log('before say');});beforeSay('hello', 'world');