What is the substitute for arguments.callee in js strict mode

the following is a timer object that will report an error in strict mode. Does the boss know how to modify it?

var Timing = function(fun,interval){
    this.fun = fun;
    this.interval = interval*1000;
    this.timer;
}
Timing.prototype = {
    constructor: Timing,
    setTime: function(){
        var that = this;
        var fun = that.fun;
        that.timer = setTimeout(function(){
            fun();
            that.timer = setTimeout(arguments.callee,that.interval);
        },that.interval);
    },
    clearTime: function(){
        clearTimeout(this.timer)
    }
}


var time = new Timing(function(){
    console.log("hello");
},1);
time.setTime();

console error: Uncaught TypeError: "caller"," callee", and "arguments" properties may not be accessed on strict mode functions or the arguments objects for calls to them

Apr.05,2021

It's impossible to replace

, but why use anonymous functions.

        that.timer = setTimeout(function cb(){
            fun();
            that.timer = setTimeout(cb,that.interval);
        },that.interval);
There is no substitute for

.


in addition, it is recommended that you learn to use ES6's let and arrow functions instead of var and that.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b334fe-2be68.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b334fe-2be68.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?