Closed futurist closed 7 years ago
Array equality is a monster in JS, think below:
[] == '' // true [] == 0 // true [''] == '' // true [0] == 0 // true [0] == '' // ----> false [''] == 0 // ----> true?? [null] == '' // true [null] == 0 // true [undefined] == '' // true [undefined] == 0 // true [[]] == 0 // true [[]] == '' // true [[[[[[]]]]]] == '' // true [[[[[[]]]]]] == 0 // true [[[[[[ null ]]]]]] == 0 // true [[[[[[ null ]]]]]] == '' // true [[[[[[ undefined ]]]]]] == 0 // true [[[[[[ undefined ]]]]]] == '' // true
You should be very careful for above!
Added! Thanks for reaching out!
Array equality is a monster in JS, think below:
You should be very careful for above!