forked from M3-Academy/challenge-algorithms-v2.0
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:
commit
fd8ac8114c
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user