首页 > 代码库 > ++ 运算符

++ 运算符

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>DEMO - Lik</title>
</head>
<body>
	<script>
		var total = 10;
		console.log(total++); // 10

		var total2 = 10;
		console.log(++total2); // 11
	</script>
</body>
</html>

  ++ 在后,先赋值再 ++

  ++ 在前,先++再赋值

++ 运算符