Skip to content

Commit 13dc0c9

Browse files
committed
Add Global and Local Scope example HTML file with JavaScript code
1 parent f624320 commit 13dc0c9

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
8+
9+
<script>
10+
// global
11+
number1 = 500;
12+
13+
function info(){
14+
15+
num1 = 900; // local
16+
17+
console.log("this is number - ",num1);
18+
console.log("this is number - ",number1);
19+
20+
21+
}
22+
23+
info();
24+
25+
26+
</script>
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
</head>
43+
<body>
44+
45+
46+
47+
48+
</body>
49+
</html>

0 commit comments

Comments
 (0)