-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2_class_1.html
More file actions
48 lines (34 loc) · 1.52 KB
/
Copy path2_class_1.html
File metadata and controls
48 lines (34 loc) · 1.52 KB
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
39
40
41
42
43
44
45
46
47
48
<!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>Document</title>
</head>
<body>
<script>
/*
class : 데이터가 직접적으로 들어있지않음.
틀, 템플릿 으로 이해하면 좋다.
- template
- no data in
- declare once
object : 클래스에서 만들어진 틀에 데이터를 넣어서 만드는것이 오브젝트이다.
- instance of a class
- data in
- created many times
class는 붕어빵 틀 과 같은개념이고 object는 틀을 갖고 만들어진 팥붕어빵, 슈크림 붕어빵, 피자 붕어빵이다. <- 속 재료들이 데이터
class는 ES6부터 도입되었다.
그 전에는 클래스를 만들지않고 object - function 을 사용했었다.
// 상속, 다양성, 추상화(걍 처음에 쉽게쓰자.. 리모컨 잘몰겠는데 전원버튼있고 채널버튼있겠지), 캡슐 -> 이거쓸려거 class씀
//
*/
class person{
name; // filed(필드: 속성)
age; // filed(필드: 속성)
speak(){};// method(행동: 함수) -> 메소드는 없는 경우도있음.
}
</script>
</body>
</html>