-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava3.html
More file actions
56 lines (52 loc) · 1.19 KB
/
java3.html
File metadata and controls
56 lines (52 loc) · 1.19 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
<!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>JavaScript3</title>
<style>
</style>
</head>
<body>
<script>
var a=10; /* 전역 변수 */
function add1() {
b=20; /* b=20 */
console.log(b);
console.log(b+c);
var c=11;
c=22;
console.log("C" + c)
}
/* add1();
console.log(a); console.lig(b) 20 20 나옴 */
function add2() {
for(i=1; i<5; i++) {
sum = sum + i
console.log("i" + i)
}
}
add2();
function hap(a, b) {
var sum=a+b;
return sum;
}
function comp(c, d) {
var max;
if(c>=d) {
max=c;
}
else if (c<d) {
max=d;
}
else(max=c)
return max;
}
/* var reply=hap(3, 5);
alert(reply) */
var rep=comp(4, 5);
alert(rep);
</script>
</body>
</html>