-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilter.js
52 lines (31 loc) · 902 Bytes
/
filter.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
49
50
51
52
(function(){
let numbers = [1,2,3,4,5,6,7,8,9,10];
let evenNumbers = numbers.filter((number)=> number % 2 ==0);
console.log(evenNumbers);
let stateWithCapitalCity = [
{
state:"Maharastra",
captial:"Mumbai",
noOfDistrict:"38"
},
{
state:"Rajasthan",
captial:"Jaipur",
noOfDistrict:"35"
},
{
state:"Andhara",
captial:"Amravati",
noOfDistrict:"36"
},
{
state:"Goa",
captial:"Panaji",
noOfDistrict:"2"
}
];
let stateWithMoreThan35Districts = stateWithCapitalCity.filter((item)=>
item.noOfDistrict > 35
);
console.log( stateWithMoreThan35Districts)
})();