javascript:function makeAdder(amount){
alert ("amount"+amount) ;
return function(number){
alert (">numer"+number) ;
alert (">amount"+amount) ;
return number+amount; };
}
var addTwo=makeAdder(2);
alert('-----');
alert(addTwo(3));
在firefox地址栏输入以上脚本
先显示
amount2
-------
>number3
> amount2
5