-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:culturecreates/footlight-app int…
…o bugfix/issue-1182
- Loading branch information
Showing
6 changed files
with
230 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export const arraysAreEqual = (arr1, arr2) => { | ||
// Check if both arrays are the same length | ||
if (arr1.length !== arr2.length) { | ||
return false; | ||
} | ||
|
||
// Sort both arrays | ||
const sortedArr1 = [...arr1].sort(); | ||
const sortedArr2 = [...arr2].sort(); | ||
|
||
// Compare each element in the sorted arrays | ||
for (let i = 0; i < sortedArr1.length; i++) { | ||
if (sortedArr1[i] !== sortedArr2[i]) { | ||
return false; | ||
} | ||
} | ||
|
||
// If no mismatches were found, the arrays are equal | ||
return true; | ||
}; |
Oops, something went wrong.