javascript - The relationship between callback functions and closures
伊谢尔伦
伊谢尔伦 2017-07-05 10:54:10
0
2
1001

Does the callback function use the closure feature? for example:

$('button').onclick = function(){ /* do sth */};
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(2)
我想大声告诉你

A=(x)=>{alert(x)};
B=(callback)=>{
let y=1;
callback(y)
};
B(A);
This way the callback is Used it

typecho

No, there is no closure here.

Closure returns function B in function A, and function B always references the layout variable of function A.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template