Created
January 8, 2017 06:24
-
-
Save basarat/90e8890ac773d5e38d29308198f8a79f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Quick array equal | |
*/ | |
export function arraysEqual<T>(a: T[], b: T[]): boolean { | |
if (a === b) return true; | |
if (a == null || b == null) return false; | |
if (a.length != b.length) return false; | |
for (var i = 0; i < a.length; ++i) { | |
if (a[i] !== b[i]) return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment