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

7 lines
270 B
JavaScript
Raw Normal View History

export function isAnagram(word1, word2) {
// implementar logica aqui
2022-10-28 18:07:47 +00:00
let primeiraString = word1.toLowerCase().split('').sort().join('');
let segundaString = word2.toLowerCase().split('').sort().join('');
return primeiraString === segundaString ? true : false;
}