once 和 它牵扯出的this
_.once = (fn) =>{
let done = false;
return function (){
return done ? undefined : ((done = true),fn.apply(this,arguments));
}
}var doPayment = _.once(()=>{
console.log("Payment is done");
})
doPayment();//Payment is done
doPayment();//undefinedLast updated