From 7cdd38ffac4e68a0dec07255a4355feeaf7c9b04 Mon Sep 17 00:00:00 2001 From: KodeurFou Date: Thu, 15 Sep 2022 20:04:50 +0200 Subject: [PATCH 1/2] sheesh --- index.js | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 9b48491..7e628e2 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,12 @@ console.log('πŸš€ It Works!'); // πŸ“ TODO: Number of filming locations // 1. Make the function return the number of filming locations function getFilmingLocationsNumber () { - return '' + let memoire = new Set() + for (let location=0; location Date: Tue, 20 Sep 2022 18:33:26 +0200 Subject: [PATCH 2/2] TD du 20/09 --- index.js | 100 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 90 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 7e628e2..16dd6b2 100644 --- a/index.js +++ b/index.js @@ -70,8 +70,6 @@ function getFilmingLocationsNumberPerYear () { locationPerYear[filmingLocations[location].fields.annee_tournage] += 1 } - - return locationPerYear } console.log(getFilmingLocationsNumberPerYear () ) @@ -85,33 +83,83 @@ console.log(getFilmingLocationsNumberPerYear () ) // } // 2. Log the result function getFilmingLocationsNumberPerDistrict () { - return {} + + let locationPerDistrict = {} + + for (let location=0; location