var a = 20;
var b = --a + 2;
console.log(a);//19
console.log(b);//21先执行减法操作再赋值
var a = 20;
var b = a-- + 2;
console.log(a);//19
console.log(b);//22先赋值再执行减法操作
var a = 20;
var b = --a + 2;
console.log(a);//19
console.log(b);//21先执行减法操作再赋值
var a = 20;
var b = a-- + 2;
console.log(a);//19
console.log(b);//22先赋值再执行减法操作
本文标题:自增、自减
本文链接:https://www.haomeiwen.com/subject/xsvdjftx.html
网友评论