-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
62 lines (50 loc) · 1.22 KB
/
index.html
File metadata and controls
62 lines (50 loc) · 1.22 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>jQuery 연습</title>
</head>
<body>
<script>
// 상수
const a = 10;
// a = 20; // error
// block단위 사용되는 변수
let b = 1;
if(true) {
let b = 2;
console.log(b) // 2
}
console.log(b) // 1
var c = 1;
if(true) {
var c = 2;
console.log(c) // 2
}
console.log(c) // 2
const arr = 'hello';
console.log('arr 은 ' + arr);
console.log(`arr 은 ${arr}`);
// arrow function : this binding할 때 편리
var func1 = function(a, b) {
return a + b;
}
const func2 = (a, b) => a + b;
console.log(func2(1, 2))
const [d, e, f] = [1, 2, 3]
console.log(e);
// 스프레드 연산자
const arr1 = [1, 2]
const arr2 = [3, 4, 5]
const arr3 = [...arr1, ...arr2]
console.log(arr3)
function abc(a, ...b) {
console.log(arguments[0])
console.log(b[0])
}
abc('nodejs','hello', 1) // 인자를 가변적으로 받을 수 있다
</script>
</body>
</html>