forked from M3-Academy/challenge-algorithms-v2.0
10 lines
332 B
JavaScript
10 lines
332 B
JavaScript
export function isAnagram(word1, word2) {
|
|
// implementar logica aqui
|
|
const word1LowerCase = word1.toLowerCase();
|
|
const word2LowerCase = word2.toLowerCase();
|
|
|
|
const word1Sorted = word1LowerCase.split('').sort().join('');
|
|
const word2Sorted = word2LowerCase.split('').sort().join('');
|
|
|
|
return word1Sorted === word2Sorted;
|
|
} |