1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h3>산술연산</h3><hr>
<script>
var x = 32;
var total = 100 + x * 2 / 4 - 3;
var div = x / 10;
var mod = x % 2;
document.writeln(x+"<br>");
document.writeln(total+"<br>");
document.writeln(div+"<br>");
document.writeln(mod+"<br>");
document.writeln("==================<br>");
////////////////////////////////////////////////
var a = 3, b = 3, c = 3;
a+=3;//a=a+3
b*=3//b=b*3
c%=2//c=c%2
document.writeln(a+"<br>");
document.writeln(b+"<br>");
document.writeln(c+"<br>");
</script>
</body>
</html>
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
'Javascript' 카테고리의 다른 글
조건 연산자(삼항연산자) 조건? true:false (0) | 2020.03.09 |
---|---|
비교 연산자, 논리 연산자 // Comparison operator, Logical operator (0) | 2020.03.09 |
상수 //literal (0) | 2020.03.09 |
3 지역변수, 전역변수 ..... (0) | 2020.03.09 |
자바스크립트로 HTML 콘텐츠 출력 (0) | 2020.03.09 |