Skip to content

Instantly share code, notes, and snippets.

@insanehong
Last active August 29, 2015 14:03
Show Gist options
  • Save insanehong/77185c299f00ace0fb95 to your computer and use it in GitHub Desktop.
Save insanehong/77185c299f00ace0fb95 to your computer and use it in GitHub Desktop.
javascript anagram check
function isAnagram(a ,b) {
if(a ===b) return true;
return (resort(a) === resort(b));
function resort(s) {
return s.split("").sort().join("");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment