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

16 lines
263 B
JavaScript
Raw Normal View History

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;
}