Skip to content

Commit 98a0b75

Browse files
committed
exo 1,2,3,4,5 faits
1 parent e98ac8c commit 98a0b75

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function getFilmingLocationsNumberPerYear () {
5353
}
5454
return {res}
5555
}
56-
console.log(getFilmingLocationsNumberPerYear())
56+
console.log()
5757

5858
// 📝 TODO: Number of filming locations by district (arrondissement)
5959
// 1. Implement the function, the expected result is an object with
@@ -64,9 +64,14 @@ console.log(getFilmingLocationsNumberPerYear())
6464
// }
6565
// 2. Log the result
6666
function getFilmingLocationsNumberPerDistrict () {
67-
return {}
67+
var res = {}
68+
for(let element in filmingLocations){
69+
let district = filmingLocations[element].fields.ardt_lieu
70+
res[district] = (res[district]+1) || 1 ;
71+
}
72+
return {res}
6873
}
69-
console.log()
74+
console.log(getFilmingLocationsNumberPerDistrict())
7075

7176
// 📝 TODO: Number of locations per film, sorted in descending order
7277
// 1. Implement the function, result expected as an array of object like:

0 commit comments

Comments
 (0)