-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathchapters_35-38(CMAD).txt
96 lines (36 loc) · 889 Bytes
/
chapters_35-38(CMAD).txt
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
1) function func (){return "abc";}
console.log(typeof func)
console.log(typeof func())
2) function func(){
var a = 10
}
func();
document.write(a)
3) function func(){
document.write("inside function<br/>")
}
document.write("outside function<br/>")
func();
4) var a = "hello";
function func(){
var a = "world";
document.write("<h1> 1"+a+"</h1>")
}
document.write("<h1>2 "+a+"</h1>")
func()
document.write("<h1> 3"+a+"</h1>")
5) var a = "hello";
function func(){
a = "world";
document.write("1 <h1>"+a+"</h1>")
}
document.write("2 <h1>"+a+"</h1>")
func()
document.write("3 <h1>"+a+"</h1>")
6) function chicken() {
return egg();
}
function egg() {
return chicken();
}
alert(chicken() + " came first.");