forked from M3-Academy/challenge-algorithms-v2.0
16 lines
263 B
JavaScript
16 lines
263 B
JavaScript
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;
|
|
} |