-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathStep07_operator.html
38 lines (35 loc) · 1.12 KB
/
Step07_operator.html
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
32
33
34
35
36
37
38
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Step07_operator.html</title>
</head>
<body>
<h1>산술 연산자에 대해 알아보기</h1>
<script>
/*
1. 산술연산자
number type 데이터를 연산할때 사용한다.
+, -, *, /, % (나머지 연산자)
*/
let result1=10+1; //11
let result2=10-1; //9
let result3=10*10; //100
let result4=10/2; //5
let result5=10%3; //1
let num1=10;
let num2=1;
//산술연산을 할때 숫자가 들어있는 변수명으로 할수도 있다.
let result6=num1+1;
let result7=num1%3;
let result8=num1-num2;
//object 혹은 array 에 들어 있는 데이터를 이용해서 연산을 할수도 있다.
let obj={first:10, second:20};
let arr=[10, 20, 30];
let result9=1+obj.first;
let result10=10*arr[1];
</script>
</body>
</html>