the sign of the zeroes should not matter, but this is a known issue with the deepEqual() matcher from the chai JavaScript assertions library that Codewars uses. it uses the Object.is() function to compare objects, and Object.is(-0, +0) === false. it seems to be possible to reconfigure this in more recent (5.0+) versions of chai, but Codewars uses 4.3.3 for now.
the sign of the zeroes should not matter, but this is a known issue with the
deepEqual()
matcher from thechai
JavaScript assertions library that Codewars uses. it uses theObject.is()
function to compare objects, andObject.is(-0, +0) === false
. it seems to be possible to reconfigure this in more recent (5.0+
) versions of chai, but Codewars uses4.3.3
for now.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
check this out:
JavaScript's object-to-string conversion is messy ;-)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I was feeling myself like L while staring at test cases
Please use spoiler flag next time, your post was visible in the homepage.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution