#Bird Watcher Task 3

4 messages · Page 1 of 1 (latest)

digital dew
#

Respectfully requesting some help. I'm stuck on Task 3. I can pass test 8 but fail test 9. Its stating that I am not creating a new array. Here is my code:

export function fixBirdCountLog(birdsPerDay) {
  const newArray = [];

  for (let i = 0; i < birdsPerDay.length; i ++) {
    if (i % 2 ===0) {
      newArray.push(birdsPerDay[i] + 1);
    } else {
      newArray.push(birdsPerDay[i]);
    }
  }
  return newArray;
}

As far as I can tell, I am creating and returning a new array. Any suggestions will be greatly appriciated.

vocal bloom
#

Can you paste the test output and the test code that is running?

digital dew
#
CODE RUN
const birdsPerDay = [2, 0, 1, 4, 1, 3, 0];
expect(Object.is(fixBirdCountLog(birdsPerDay), birdsPerDay)).toBe(true);
TEST FAILURE
Error: expect(received).toBe(expected) // Object.is equality

Expected: true
Received: false
vocal bloom
#

Double check the test name. I think it's checking the very opposite of what you said it's checking.