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

11 lines
270 B
JavaScript
Raw Permalink Normal View History

export function isAnagram(word1, word2) {
// implementar logica aqui
2022-10-30 18:48:18 +00:00
if (cleanString(word1) === cleanString(word2)) {
return true;
} else {
return false;
};
}
function cleanString(str) {
return str.toLowerCase().split('').sort().join();
2022-10-30 15:48:44 +00:00
}