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.
I've checked by solving, my code is working. maybe for some input your code returns 3 but should return 6.
you could print input to console and look what input you're failing at
https://docs.codewars.com/training/troubleshooting#print-input
Hidden tests are not passing 'expected 3 to equal 6'. can you please check?
Your code fails because
console.log(Number('['))
outputsNaN
and anything whose sums includeNaN
returnsNaN
My code is working fine on browser console, but not here. why?
There is no test expecting NaN. It seems your function is returning NaN instead of 6. Print the input: https://docs.codewars.com/training/troubleshooting#print-input see why your code is failing.
expected NaN but it's 6, why? I passed all tests, but I got that mistake when I pressed attempt and I don't know how to see where is a mistake, in desc no info about "when I should to return NaN?"???
reraised as issue
Node 18. should be enabled
No random tests
no, not in Node 10.x
TypeError: arr.flat is not a function
at arraySum (test.js:3:29)
at Context.it (test.js:8:19)
arr.flat is not a function ?!?
This comment is hidden because it contains spoiler information about the solution
Python translation
Too late.
Loading more items...