challenge-algorithms-v2.0-v.../08-isAnagram/index.js

8 lines
237 B
JavaScript
Raw Permalink Normal View History

export function isAnagram(word1, word2) {
// implementar logica aqui
2022-10-28 15:05:06 +00:00
word1 = word1.toLowerCase().split('').sort().join('');
word2 = word2.toLowerCase().split('').sort().join('');
if(word1 == word2) return true;
return false;
}