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

16 lines
263 B
JavaScript

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