小编Kim*_*omo的帖子

有人可以解释为什么下面的增量没有添加 +1

有人能帮我解释一下为什么会这样吗

let one = 1;

function chg(arg) {
  return arg++ // --> shouldn't this be similar to arg + arg? but it's outputting 1
}

console.log(one);
console.log(chg(one));
Run Code Online (Sandbox Code Playgroud)

javascript

-6
推荐指数
1
解决办法
72
查看次数

标签 统计

javascript ×1