File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff 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
6666function 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:
You can’t perform that action at this time.
0 commit comments