Merge pull request 'feat: cria algoritmo que retorne se um palavra é anagram da outra.' (#8) from feature/isAnagram into development/desafio-02

Reviewed-on: EmmanuelVitor/challenge-algorithms-v2.0-EmmanuelVitor#8
This commit is contained in:
Emmanuel Vitor Pereira de Jesus 2022-10-31 16:55:59 +00:00
commit fd8ac8114c

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;
}