forked from M3-Academy/challenge-algorithms-v2.0
11 lines
270 B
JavaScript
11 lines
270 B
JavaScript
export function isAnagram(word1, word2) {
|
|
// implementar logica aqui
|
|
if (cleanString(word1) === cleanString(word2)) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
};
|
|
}
|
|
function cleanString(str) {
|
|
return str.toLowerCase().split('').sort().join();
|
|
}
|