challenge-algorithms-v2.0-n.../08-isAnagram/index.js
2022-10-28 10:49:59 -03:00

6 lines
239 B
JavaScript

export function isAnagram(word1, word2) {
// implementar logica aqui
word1 = word1.toUpperCase().split('').sort().join('');
word2 = word2.toUpperCase().split('').sort().join('');
return word1 === word2
}