Does the callback function use the closure feature? for example:
$('button').onclick = function(){ /* do sth */};
我想大声告诉你2017-07-05 10:56:10
A=(x)=>{alert(x)};
B=(callback)=>{
let y=1;
callback(y)
};
B(A);
This way the callback is Used it
typecho2017-07-05 10:56:10
No, there is no closure here.
Closure returns function B in function A, and function B always references the layout variable of function A.