Subtle bug
elclanrs opened this issue · 2 comments
elclanrs commented
This program has a subtle bug. Open issue if you found it and I'll give you credit.
Since object keys are strings, anything that's not a string will be stringified, which will make the following true:
1 === '1'
{} === {}
[] === []
//...
erykpiast commented
👍
But I would use ==
:) More scary thing regarding this is [[]] == ''
.
Beside that, when you have undefined
or null
in array, function returns strings 'undefined'
and 'null'
.