We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef742e5 commit c5acfd2Copy full SHA for c5acfd2
index.js
@@ -236,3 +236,13 @@ console.log(getLongestDuration())
236
// 📝 TODO: Compute the average filming duration
237
// 1. Implement the function
238
// 2. Log the result
239
+function getAverageFilmDuration(){
240
+ let average = 0;
241
+ for(let i of filmingLocations){
242
+ let time = new Date(i.fields.date_fin)- new Date(i.fields.date_debut);
243
+ average += time;
244
+ }
245
+ average/=filmingLocations.length;
246
+ return duration(average);
247
+}
248
+console.log(getAverageFilmDuration())
0 commit comments