-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJS6.html
More file actions
42 lines (38 loc) · 1.24 KB
/
JS6.html
File metadata and controls
42 lines (38 loc) · 1.24 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Arrays and Objects</title>
</head>
<body>
<div class="container">
<h1>hello this is java script tutorial</h1>
</div>
<script>
let myVar = 34;
let myVar1 = 'STRING';
let myVar2 = true;
let myVar3 = null;
let myVar4 = undefined;
// These all values are called primitive value
let employee = {
name: 'John',
age: 25,
salary: 10000,
channel: 'WebFusionCode',
}
// This is Object different with primitiv value because object contains more than one value
console.log(employee);
let names = new Array (4,1,2,3,'Harsh', undefined);
// This is also a array defined in different way
// Arrays are also the type of object its also contains differents types of values
// let names = [1,2,3,'Harsh', undefined];
// console.log(names.length);
// names = names.sort();
// names.push("This is phushed element");
// console.log(names[3 ]);
// console.log(names);
</script>
</body>
</html>