<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
// a++和++a都是拿整体来运算的
// ++a是先附给整体再运算
// a++是先运算再附给整体
let a = 10;
// let b = a++;
// 先进行b=a; 再进行a = a+1;
// 此时 a=11-vue-router b=10-vue-router
let b = ++a;
// a = a+1; b = a;
// 先进行++a; 再进行b=a
// 此时 a=11-vue-router b=11-vue-router
console.log(a);
console.log(b);
let c = 10;
let d = 5;
console.log(c+++d); //>>15
console.log(c); //11-vue-router
console.log(d); //5
</script>
</body>
</html>
浙公网安备 33010602011771号