forked from M3-Academy/challenge-algorithms-v2.0
feat: Algoritmo 08-isAnagram - finalizado
This commit is contained in:
parent
9759d796da
commit
4627081856
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user