feat: cria algoritmo que retorne se um palavra é anagram da outra.

This commit is contained in:
Emmanuel Vitor Pereira de Jesus 2022-10-31 13:54:53 -03:00
parent 5a8fa6be43
commit 642f731562

View File

@ -1,4 +1,8 @@
export function isAnagram(word1, word2) {
// implementar logica aqui
let newWord = word1.toLowerCase().split("").sort().join();
let newWord2 = word2.toLowerCase().split("").sort().join();
return (newWord === newWord2) ? true : false;
}