-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject.html
More file actions
66 lines (56 loc) · 1.14 KB
/
Copy pathobject.html
File metadata and controls
66 lines (56 loc) · 1.14 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Object</title>
</head>
<body>
<script>
// function user(name,age,income,position){
// this.name = name;
// this.age = age;
// this.income = income;
// this.position = "position";
// }
// const Kunal = new user
const obj= {
name: 'Kunal',
age: 19,
skills: ["python", "java"],
position: ['CEO'],
Income: '₹ 120000000',
}
console.log(obj);
obj.position[1]='MD',
// we can't print whole object, but we can print elements of object.
// So here I am printing obj.name
document.write(obj.name)
const obj1 = {
screen_size : "6inch",
color : "blue",
brand : "vivo",
price : CALCULATE(),
ROM : "64GB",
RAM : "4GB",
processor : "octa core",
battery : "5000mAh",
camera : "13MP",
}
function CALCULATE(){
return 20000;
}
console.log(obj1);
const student = {
firstName: 'Kunal',
lastName: 'Garg',
Course: 'B.tech',
Branch: 'C.S.E',
Semester: 3,
Roll_No: 2204710100063,
age: 19,
}
console.log(student);
</script>
</body>
</html>