Skip to content

Instantly share code, notes, and snippets.

@mactanxin
Created June 19, 2020 06:03
Show Gist options
  • Save mactanxin/239db60e05c131f3e26ebed9f78e7d02 to your computer and use it in GitHub Desktop.
Save mactanxin/239db60e05c131f3e26ebed9f78e7d02 to your computer and use it in GitHub Desktop.
Array.prototype.equals = function (arr) {
if(arr.length !== this.length) {
return false;
}
for (var i = arr.length - 1; i >= 0; i--) {
if (this[i] !== arr[i]) {
return false;
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment