[a] 打印日志

const originalApply = Function.prototype.apply;
Function.prototype.apply = function(context, args) {
    console.log('apply called with:', this, context, args);
    console.trace(); // 打印调用堆栈
    return originalApply.apply(this, [context, args]);
};

你可能感兴趣的:(javascript,前端,开发语言)