forked from M3-Academy/challenge-algorithms-v2.0
Merge pull request 'feat(isAnagram): algoritmo criado.' (#8) from feature/algorithm08 into development
Reviewed-on: #8
This commit is contained in:
commit
efa764ec1f
@ -1,4 +1,8 @@
|
||||
export function isAnagram(word1, word2) {
|
||||
// implementar logica aqui
|
||||
let array1 = word1.toLowerCase().split('').sort();
|
||||
let array2 = word2.toLowerCase().split('').sort();
|
||||
|
||||
if(array1.join() === array2.join()) return true;
|
||||
else return false;
|
||||
}
|
Loading…
Reference in New Issue
Block a user