Quantcast
Channel: C++博客-所有随笔
Viewing all articles
Browse latest Browse all 7882

闭包-初级概念

$
0
0
通俗的说:子函数可以使用父函数中的局部变量,这种行为就叫做闭包!
function a(){
var i=0;
function b(){
alert(++i);
}
return b;
}
var c = a();
c();


零圈圈 2013-07-04 14:28 发表评论

Viewing all articles
Browse latest Browse all 7882

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>