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.
OP solved it, closing
Nice one man!
Add
console.log(x);
inside your function, make it the first line. See the output panel, the last line you see there is the input that makes your code fail. Once you know which input makes your code fail, you can analyze where in your code you're making a mistake.It's failing that one for instance.
To debug your code. See what the input is, and then you can try the same input in VSC.
Start by printing the input.
The fixed test your code isn't passing is this:
And the input is not an empty array. The javascript tests never pass an empty array to the function.
... but its you who added a call with an empty array into your solution?
Tests should not pass in empty arrays. Did you have such problem also before you added the call with empty array into your code?
No problem.
No, because the tests ask for two separate functions that do what I posted above. Normally, smaller and reutilizable functions are better than bigger and more complex ones.
No, you're mistaken, -65 is the sum, not the count, and it's the same for all the other tests. A count would never be negative.
I don't know where are you seeing otherwise.
Where is the issue?
Initial code:
Two functions, each returns either the minimum or the maximum. Please mark your post as having spoiler content next time.
See the quotes around your answer, your function is returning a string instead of a number.