feat(isAnagram): funcao feita

This commit is contained in:
Nicolly Vieira Santos Costa 2022-10-28 15:07:47 -03:00
parent e92bfc7d68
commit 9861989bed

View File

@ -1,4 +1,7 @@
export function isAnagram(word1, word2) { export function isAnagram(word1, word2) {
// implementar logica aqui // implementar logica aqui
let primeiraString = word1.toLowerCase().split('').sort().join('');
let segundaString = word2.toLowerCase().split('').sort().join('');
return primeiraString === segundaString ? true : false;
} }