Does the callback function use the closure feature? for example:
$('button').onclick = function(){ /* do sth */};
小伙看你根骨奇佳,潜力无限,来学PHP伐。
A=(x)=>{alert(x)};B=(callback)=>{let y=1;callback(y)};B(A);This way the callback is Used it
No, there is no closure here.
Closure returns function B in function A, and function B always references the layout variable of function A.
A=(x)=>{alert(x)};
B=(callback)=>{
let y=1;
callback(y)
};
B(A);
This way the callback is Used it
No, there is no closure here.
Closure returns function B in function A, and function B always references the layout variable of function A.