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
2 0 8

comments (single view)

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
View all comments