-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
52 lines (50 loc) · 1.3 KB
/
index.html
File metadata and controls
52 lines (50 loc) · 1.3 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
<!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>Data Type</title>
<style>
body {
height: 100vh;
display: flex;
align-items: center;
background-color: skyblue;
}
h1 {
font-family: sans-serif;
font-size: 50px;
line-height: 1.3;
width: 100%;
padding: 30px;
text-align: center;
color: white;
}
</style>
</head>
<body>
<h1>Go to console</h1>
<script>
// Store different data type values in a variable
const num = 15; //'number'
const txt = "Delhi"; //'string'
const bool = true; //'boolean'
let nothing; //undefined
const bio = {
//object
fName: "Shailesh",
lName: "Kala",
birthyear: 2000,
};
const friends = ["Rahul", "Ashish", "Rohit", "Manoj"]; //object
const calcAge = function () {
const age = 2021 - bio.birthyear;
}; //function
//Insert any type of variable into 'output' variable with 'typeof'
output = typeof bio;
//Print output in console
console.log(output);
</script>
</body>
</html>