forked from M3-Academy/challenge-algorithms-v2.0
feat(isAnagram): algoritmo criado.
This commit is contained in:
parent
5ee32678bf
commit
3781d8d204
@ -1,4 +1,8 @@
|
|||||||
export function isAnagram(word1, word2) {
|
export function isAnagram(word1, word2) {
|
||||||
// implementar logica aqui
|
// 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