Skip to content

Instantly share code, notes, and snippets.

@lynxerzhang
Created May 13, 2020 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lynxerzhang/5940299acaf1d2b925ede8d41d32a965 to your computer and use it in GitHub Desktop.
Save lynxerzhang/5940299acaf1d2b925ede8d41d32a965 to your computer and use it in GitHub Desktop.
js check if two arrays are equal or not
//es6
const checkAryisEqual = (aryA, aryB) => JSON.stringify(aryA) == "[" + aryB.toString() + "]";
//es5
function checkAryisEqual(aryA, aryB) {
return JSON.stringify(aryA) === "[" + aryB.toString() + "]";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment