Joyeuxman / Joyeuxman.github.io

个人博客
1 stars 0 forks source link

操作符 #16

Open Joyeuxman opened 5 years ago

Joyeuxman commented 5 years ago

前置递增与后置递增

前置递增

let num1 = 2;
let num2 = 20;
let num3 = --num1 + num2; // 21
let num4 = num1 + num2; // 21

后置递增

let num1 = 2;
let num2 = 20;
let num3 = num1-- + num2; // 22
let num4 = num1 + num2; // 21

位操作符(奇淫技巧,让阅读代码的人会困惑)