Tests play very loose with datatypes. My solution has this
.map( v=>v===true||isNaN(v) ?v : Number(v) )
in it, and that's weird, given that the tests cast everything to a String ( twice actually! ) before comparing it.
But it's been a year, I don't immediately see what the problem is and I'm not about to invest time in it really.
I think NaN was taken out of the random generator later - author apparently didn't know that NaN !== NaN and couldn't think of ! array[i] (?!). I still think it's a trainwreck.
It is language dependent, things like nill, undefined, etc. As JS can basically do odd things, there really are no invalids, hence you strip all falsy, only in JS.
Kata retired.
The description says if same return
same
, but the test says it should returnSame
.Retired.
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/136.
Please join the discussion to help us identify duplicate kata and retire them.
Not a kata issue. Please read this: https://docs.codewars.com/training/troubleshooting/
My code passes the tests, all green, but it will not submit, instead of comes up with an error, what am I missing here?
You can use
console.log
to get the inputRuby 3.0 should be enabled.
Tests play very loose with datatypes. My solution has this
in it, and that's weird, given that the tests cast everything to a
String
( twice actually! ) before comparing it.But it's been a year, I don't immediately see what the problem is and I'm not about to invest time in it really.
I think
NaN
was taken out of the random generator later - author apparently didn't know thatNaN !== NaN
and couldn't think of! array[i]
(?!). I still think it's a trainwreck.Johan, I can fix the JS if I knew exactly what problem you have. What does it mean by "similar" values in JS?
What language?
It means a number as a number, or a string with a number in it.
It means a number as a number, or a string with a number in it.
The only falsey is just for JS.
It is language dependent, things like nill, undefined, etc. As JS can basically do odd things, there really are no invalids, hence you strip all falsy, only in JS.
Loading more items...