export function birdsInWeek(birdsPerDay, week) {
let total = 0;
for(let i = 0; i < birdsPerDay.length; i++) {
total += birdsPerDay[i];
}
return total;
}
I have read the exercise many times, but I cannot understand it well. What makes it difficult for me to start.
2 task: Now that you got a general feel for your bird count numbers, you want to make a more fine-grained analysis.
Implement a function birdsInWeek that accepts an array of bird counts per day and a week number. It returns the total number of birds that you counted in that specific week. You can assume weeks are always tracked completely.