Merge branch 'feature/08-isAnagram' into development

This commit is contained in:
Andrea Matsunaga 2022-11-01 13:35:10 -03:00
commit 588770824a

View File

@ -1,4 +1,8 @@
export function isAnagram(word1, word2) {
// implementar logica aqui
if (word1.length != word2.length) return false
let sortedWord1Array = [...word1.toLowerCase()].sort()
let sortedWord2Array = [...word2.toLowerCase()].sort()
return (sortedWord1Array.join('') === sortedWord2Array.join(''));
}