html
html
1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
css
css
1
2
3
4
body
{
}
js
js
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
// ----------------------------
// 1. Declaration without assignment
// ----------------------------
let a;
console.log("a:", a); // 👉 undefined
// 'a' is declared but not assigned any value, so JavaScript automatically sets it to undefined.
// ----------------------------
// 2. Explicit assignment of undefined
// ----------------------------
let b = undefined;
console.log("b:", b); // 👉 undefined
// You can explicitly assign undefined, but this is rarely needed.
// ----------------------------
// 3. null means 'intentional absence of value'
// ----------------------------
let c = null;
console.log("c:", c); // 👉 null
// 'c' is intentionally set to null, indicating we *expect* something later but it's empty for now.
// ----------------------------
// 4. typeof behavior
// ----------------------------
BROWSER
Console
Run