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

12 lines
267 B
JavaScript
Raw Permalink Normal View History

export function isAnagram(word1, word2) {
// implementar logica aqui
2022-10-28 13:55:14 +00:00
let str1 = word1.toLowerCase().split("").sort().join("");
let str2 = word2.toLowerCase().split("").sort().join("");
if (str1 === str2) {
return true;
} else {
return false;
}
}