feat: Algoritmo 08-isAnagram - finalizado

This commit is contained in:
José Carlos Lins 2022-10-27 20:38:09 -03:00
parent 9759d796da
commit 4627081856

View File

@ -1,4 +1,16 @@
export function isAnagram(word1, word2) {
// implementar logica aqui
const compare = str =>
str
.toLowerCase()
.split('')
.sort()
.join('');
if(compare(word1) === compare(word2)){
return true;
}
return false;
}