-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScope.html
More file actions
83 lines (75 loc) · 1.61 KB
/
Copy pathScope.html
File metadata and controls
83 lines (75 loc) · 1.61 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Scope | JavaScript | Al- Arafat </title>
</head>
<body>
<H1> Assalamualaikum Or-Rohmatullah </H1>
<H2> Al - Arafat </H2>
</body>
<script src="Scope.js"></script>
<script src="test-13.js"></script>
<script>
// Type-1:
/*
Scope ==>
{
} :
*/
let a = 10
const b =20
var c = 30
d = 40
/*
console.log(a);
console.log(b);
console.log(c);
console.log(d);
*/
if (true)
{
let a = 10
const b =20
var c = 30
d = 40
}
/*
console.log(a);
console.log(b);
console.log(c);
console.log(d);
*/
/*
// Block Scope:
if (true) {
let a = 10
const b =20
var c = 30
d = 40
}
*/
/*
// Global Scope:
//var c = 300 //don't use var
let f = 300
if (true) {
let f = 10
console.log("Inner: ",f);
}
console.log("Outer:",f);
*/
/*
For Loop Syntax:
for (let index = 0; index < array.length; index++) {
const element = array[index];
}
*/
/*
Difference's between Block Scope & Global Scope:
Block Scope :" { } " এর ভিতরে যা কিছু থাকবে সব কিছুই Block Scope ।
Global Scope: " { } " এর বাহিরে যা কিছু থাকবে সব কিছুই Global Scope ।
*/
</script>
</html>