Skip to content

Instantly share code, notes, and snippets.

@santhosh-chinnasamy
Created September 19, 2018 15:15
Show Gist options
  • Save santhosh-chinnasamy/0f1655e43dc40d4fbdd5dbd03cbc868f to your computer and use it in GitHub Desktop.
Save santhosh-chinnasamy/0f1655e43dc40d4fbdd5dbd03cbc868f to your computer and use it in GitHub Desktop.
function anagram(s1,s2){
var x= s1.split('').sort().join('');
var y = s2.split('').sort().join('');
if(x==y){
console.log(x,y);
}
else{
console.log("nope");
}
}
anagram("and","dan")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment