-
Notifications
You must be signed in to change notification settings - Fork 0
/
10.js
49 lines (45 loc) · 863 Bytes
/
10.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// array of objects
const student=[
{
name:"sidra",
rollno:1,
class:"web 3.0"
},
{
name:"rida",
rollno:2,
class:"web 3.0"
},
{
name:"fiza",
rollno:3,
class:"web 3.0"
},
{
name:"hira",
rollno:4,
class:"web 3.0"
}
];
const oneobject={
name:"sidra",
rollno:1,
class:"web 3.0",
courses:["english","maths"],
adress:{
city: "islamabad",
country: "pakistan"
},
f1: function(){
return this.name + " khalid"
}
};
console.log(oneobject);
console.log(oneobject.name);
console.log(oneobject.courses[1]);
console.log(oneobject.adress.city);
console.log(oneobject.f1());
console.log(student);
console.log(student[0]);
console.log(student[1].rollno);
console.log(student[3].class);