wynd @wynd

answered: arrays cant be checked for equality, thanks oren

does anyone here know why

[typeof "this is a string", typeof "also a string"] == ['string', 'string']

returns false?

Oct 18, 2022, 10:45 PM
8
View all

comments

Highlighted comment

If you want to know why arrays can’t be checked for equality, it’s because two objects must be the exact same for == to return true

For example:

[] == [] // false
x = []; x == x // true