Problems with loops and timers

  1. all know that if you set a timer in a loop, use var and do not change the internal function to execute the function immediately, it will print out 5

    in the loop.
       

Mar.05,2021

the third is because the first argument you pass into setInterval is actually the result of the execution of a function, not a function


because there is no callback

let a = function(i){
    console.log(i,"i")
}(i)

a;//undefined
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-1ea3421-47a22.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-1ea3421-47a22.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?