-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
75 lines (66 loc) · 1.48 KB
/
index.js
File metadata and controls
75 lines (66 loc) · 1.48 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
67
68
69
70
71
72
73
74
75
//console.log("Hello UjHub");
//var Salutation = "welcome to Ujhub University of Jos.";
//console.log (Salutation);
//Salutation = 100;
//console.log (Salutation);
var student = ["Elizabeth",
20,
true
];
//student.forEach((value)=>{
//console.log(value);
//});
var age = student.filter((value)=> value == 20);
console.log(age);
var ages =[20, 25, 30,18,14,13,22,45,50,10];
var validAges = ages.filter((age)=> age > 18);
console.log(validAges);
var me = {
name: "Emmanuel ELizabeth John",
age: 25,
department: "CSC",
level: 300,
grade: [65, 60, 75, 80,85,90,95,100]
};
console.log (me.name);
console.log (me.grade);
console.log (me.grade[0]);
var students = [
{ name: "Emmanuel ELizabeth John",
age: 25,
department: "CSC",
level: 300,
grade: [65, 60, 75, 80,85,90,95,100]
},
{ name: "Odezogu Edwin Nnaemeka",
age: 29,
department: "Eng",
level: 500,
grade: [66, 70, 75,80,85,90,95,100]
},
{ name: "Emmanuel Nathan Joe",
age: 19,
department: "Doctor",
level: 100,
grade: [70, 74, 75, 80,85,90,95,100]
},
{ name: "Sunday Joesph Bassey",
age: 29,
department: "Physic",
level: 400,
grade: [65, 60, 75, 80,85,90,95,100]
},
{ name: "Ekeng Ruth Nsa",
age: 21,
department: "Accounting",
level: 300,
grade: [68, 72, 75, 80,85,90,95,100]
}
];
var studentA = students.filter( (student)=> student.age > 18);
console.log(studentA);
var studentA = students.filter((student)=> student.name.includes("Emmanuel"));
console.log(studentA);
studentA.forEach(s=>{
console.log(s.name);
});