Js语法一元运算符、Js语法_算数运算符
Js语法一元运算符
运算符:
1,一元运算符:只有只有一个运算数的运算符
++ -- ,+(正好)
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
// alert("你好")
var aa = 1;
var bb = 1.2;
document.write(aa+"--"+typeof+"<br>")
document.write(bb+"--"+typeof+"<br>")
alert(bb+1)
</script>
</head>
Js语法_算数运算符
2,算数运算符
+ - * / % ....
案例:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
// alert("你好")
var aa = 1;
var bb = 1.2;
// document.write(aa+"--"+typeof+"<br>")
// document.write(bb+"--"+typeof+"<br>")
document.writeln(aa+bb)
document.writeln(aa-bb)
document.writeln(aa*bb)
document.writeln(aa/bb)
</script>
</head>
<body>
</body>
</html>