在此函数中,我期望返回值是变量值的增量。但是,我得到了原始值,
这是我的功能:
var num = function(){
var a = 0;
return a++;
}
alert(num()); //it giving the result as 0 instead of 1...why?
谁能给我解释一下吗?
最佳答案
关于需要 javascript 函数返回说明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18636459/