About the parameters of the self-executing function?

for (var iMago dint arr = []; I < = 3pi) {

arr.push(
  (function(h){
    return function(){
      console.log(i);
    }
  })(i)
);

}
arr [0] (); / / 4
is also a question asked today, that is, are there any requirements for the parameters of anonymous functions? I used to understand that h is just a formal parameter and can be written as anything. But the result is not 0 as imagined, but 4. After changing h to I, the result is 0. What"s going on? shouldn"t that h be just a parameter

?
Mar.15,2021

these two functions are anonymous functions, so I become called functions and inner functions.
the parameter of the outer function is h , but you do not use the parameter h in the outer function body, so each generated inner function uses the final variable I . Each time function () {console.log (i)} is returned.
and if you use the following form:

 

console.log (h) Thank you

console.log (i), the automatic execution function you write is meaningless

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-1e521f0-444e1.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-1e521f0-444e1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?