When was the closure generated?

when is the closure generated? Is it when the function is defined or when it is executed?

= add =
from "JavaScript you don"t know". There is no free variable in the callback of click binding, so why is it a closure?

Mar.25,2022

scope is generated when the function is defined, and references to variables in the outer scope produce closures


http://liximomo.github.io/jav...


closure, actually refers to the closure function, refers to a function using variables outside the scope of the function, the function is called the closure function. For example:

let name = 'test';
//  
// 
function say(){
    //   name
    console.log(name);
}
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-1b35714-40fd5.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-1b35714-40fd5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?