Compare two arrays regardless of order
dmytrohavrysh opened this issue · 0 comments
dmytrohavrysh commented
This code doesn't work in some cases:
// Or
const isEqual = (a, b) => a.length === b.length && a.every((v) => b.includes(v));
For example:
isEqual(['a', 'a'], ['b', 'a'])
gives true, but it must be false.