JavaScript on Exercism 008 - Bird Watcher

preview_player
Показать описание
Walkthrough for Exercism JavaScript section exercise 8: "Bird Watcher"

Do the exercises on Exercism yourself (it's free) and refer to the walkthrough when you get stuck.

-------------------------------------------------------------------
Timestamps:
0:00 Intro
0:55 Task 1 | Determine the total number of birds that you counted so far
4:57 Task 2 | Calculate the number of visiting birds in a specific week
11:23 Task 3 | Fix a counting mistake
15:00 Outro
-------------------------------------------------------------------
-------------------------------------------------------------------
Music by Silent Partner
-------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

Wow, i did the task 2 more longer than yours, i learned a lot with this, thanks mate!

yungarepa
Автор

so, my greatest challenge here was understanding what question number 2 was asking. Once you explained that, i ran off to create an eccentric use of the slice method. The code works, but i dont know if its considered "good" code.

export function birdsInWeek(birdsPerDay, week) {
let sum = 0;
const newArr = birdsPerDay.slice(week * 7 - 7, week * 7);
for (let index = 0; index < newArr.length; index++) {
sum += newArr[index];
}
return sum;
}

anyone know if this is professionally acceptable? still new.

aresix
Автор

I don't get how this is a learning exercise. I am completely overwhelmed by this. I only remember a bit of the stuff in the last learning exercises.

respectthedripkaren