自增、自减
2018-05-23 本文已影响0人
RushTL
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先赋值再执行减法操作