#bird watcher task 3

15 messages ยท Page 1 of 1 (latest)

barren bloom
#

ive done everything i can to solve the problem and the test still fails? what am i doing wrong: ```export function fixBirdCountLog(birdsPerDay) {
for(let i = 0; i < birdsPerDay.length; i++){
if(i % 2 == 1){
birdsPerDay[i] = birdsPerDay[i] + 1;
}

}
return birdsPerDay;

}```

#

it checks if the index is odd and increments if it is

#

so why isnt this solution working

marble holly
#
  1. What track?
  2. What do the tests say?
barren bloom
#

javascript and this

silent peak
#

The description isn't the most clear, but check the example in the learning concept and notice on which indexes the example array is changing.

marble holly
#

Please use codeblocks and not images ๐Ÿ˜‰

#

That output ain't super helpful ๐Ÿ˜ฆ But it tries to show that every element is off by one.

silent peak
#

If you read the instructions carefully, not only the comment above the function, you should find out what's different.

marble holly
#
Expected: [4, 0, 6, 1, ...]
Got:      [3, 1, 5, 2, ...]
barren bloom
#

so would it just be changing the i % 2 == 1 to i % 2 ==0

silent peak
#

Try it out and see if that's enough

marble holly
#

Ask the computer, not the human ๐Ÿ˜„

barren bloom
#

oh my it works, sorry for wasting yalls time

marble holly
#

๐ŸŽ‰