Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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. .)
As I said, your
.reduce
is not working. JS is weird when it comes to implicitbool -> int
conversion, and it's not happenning here..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
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".
This comment is hidden because it contains spoiler information about the solution