Memory overflow caused by the first parameter of setTimeout without quotation marks

Web page display online time: `

    var timeblc = document.getElementById("nowtime");
    var weekdays = ["", "", "", "", "", "", ""];
    function addZero(t){
        if(t<10) return "0"+t;
        return t;
    }
    function showTime(){
        var time = new Date();
        var t = time.getFullYear()+""+getMonthDay(time)+getWeekday(time)+getHMS(time);
        timeblc.innerHTML = t;
        setTimeout("showTime()",1000);      //
    }
    function getMonthDay(time){
        var m = addZero(time.getMonth()+1);
        var d = addZero(time.getDate());
        var str = m+""+d+"";
        return str;
    }
    function getWeekday(time){
        var str = weekdays[time.getDay()];
        return str;
    }
    function getHMS(time){
        var h = addZero(time.getHours());
        var m = addZero(time.getMinutes());
        var s = addZero(time.getSeconds());
        var str = h+":"+m+":"+s;
        return str;
    }
    showTime();`
At the

code comment, the first parameter will cause a memory overflow if it does not add quotation marks:

after checking on the Internet, we can see that quotation marks will look for it globally, and if not, it will look for local variables. However, there is no relationship between the overflow and the way variables are queried.

ask for advice!

Mar.28,2021

the first argument to setTimeout should be the function to be executed

setTimeout(showTime, 1000);

execute the function showTime without quotation marks. This creates a recursive dead loop. The setTimeout function call is written as follows:

  1. setTimeout (fn, timeout)
  2. setTimeout ('fn ()', timeout)
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-1e50aca-43e07.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-1e50aca-43e07.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?