-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNull.html
More file actions
30 lines (25 loc) · 815 Bytes
/
Null.html
File metadata and controls
30 lines (25 loc) · 815 Bytes
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
<!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>Hull</title>
</head>
<body>
<script>
let fullname = null;
if (fullname === null) {
document.writeln("This is value Null");
} else if (fullname === undefined) {
document.writeln("This is value Undefined");
} else {
document.writeln(`${fullname}`);
}
// nullish coalescing Operator
// valiabe = codition value not null/undefined ?? condition value null/undifined
let data = fullname ?? "This is value null with nullish";
document.writeln(`<h1>${data}</h1>`);
</script>
</body>
</html>