gpt4 book ai didi

javascript - counter++ 与 counter = counter+1;

转载 作者:行者123 更新时间:2023-11-29 10:12:37 26 4
gpt4 key购买 nike

<分区>

var counter = 0;
var increment = function(){
return counter++;
// return counter=counter+1;
}

console.log(increment());

为什么 counter++; 返回 0 而 counter = counter +1; 返回 1?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com