function say(){
console.log("say",arguments)
}
Function.prototype.beforeSay = function(callback){
return (...args)=>{
callback()
// 调用原函数
this(...args)
}
}
say.beforeSay(function(){
console.log("beforeSay")
})("hello", "world")
网友评论