challenge-algorithms-v2.0-t.../08-isAnagram/index.js
2022-10-29 00:19:20 -03:00

6 lines
212 B
JavaScript

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