Created
May 13, 2020 05:52
-
-
Save lynxerzhang/5940299acaf1d2b925ede8d41d32a965 to your computer and use it in GitHub Desktop.
js check if two arrays are equal or not
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
//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