-
-
Notifications
You must be signed in to change notification settings - Fork 108
Two arrays with same elements but different orders should be considered as equal #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @kitz17 I don't understand why two arrays with same elements but different orders should be considered as equal. You can get true if uses:
|
Order is a first-class property of arrays. Two arrays of varying order whose contents are the same will behave differently. They are unequal. If you need this behaviour, |
It does not solve this problem: |
If you want order not to matter, sort your arrays first. |
equal([1,2,3], [1,2,3]) -> true
equal([1,2,3], [3,2,1]) -> false
How to get the true from the second statement?
The text was updated successfully, but these errors were encountered: