feat(isAnagram): algoritmo criado.

This commit is contained in:
Luiz Felipe Silva 2022-10-31 22:32:53 -03:00
parent 5ee32678bf
commit 3781d8d204

View File

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