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

12 lines
244 B
JavaScript

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