Ad
  • Default User Avatar

    It`s true, my solution of .reduce doesn´t work propertly but when I changed to loop - boolean and be able to represent the null value, it worked perfectly. .)

  • Custom User Avatar

    As I said, your .reduce is not working. JS is weird when it comes to implicit bool -> int conversion, and it's not happenning here.

  • Default User Avatar

    .reduce works fine, My question is if is something I missed in my solution ..but don´t worries, I´ll figure out!!
    Test Passed
    There are 500 sheeps in total, not NaN
    There are no sheeps at all, you counted NaN

  • Custom User Avatar

    You should return a number, and I'm not sure whether your .reduce is working correctly (and I don't care enough to look into it).

    And next time give at least some minimum information concerning your problem except "my code is not working".

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution