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('[')) outputs NaN and anything whose sums include NaN returns NaN
console.log(Number('['))
NaN
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 collection data...
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...