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

11 lines
270 B
JavaScript

export function isAnagram(word1, word2) {
// implementar logica aqui
if (cleanString(word1) === cleanString(word2)) {
return true;
} else {
return false;
};
}
function cleanString(str) {
return str.toLowerCase().split('').sort().join();
}