在这个函数中,我期望返回值是变量 value 的增量。但是,我得到了原始价值,
这是我的功能:
var num = function(){
var a = 0;
return a++;
}
alert(num()); //it giving the result as 0 instead of 1...why?
谁能给我解释一下?
在这个函数中,我期望返回值是变量 value 的增量。但是,我得到了原始价值,
这是我的功能:
var num = function(){
var a = 0;
return a++;
}
alert(num()); //it giving the result as 0 instead of 1...why?
谁能给我解释一下?