forked from M3-Academy/challenge-algorithms-v2.0
Merge branch 'feature/08-isAnagram' into development
This commit is contained in:
commit
588770824a
@ -1,4 +1,8 @@
|
|||||||
export function isAnagram(word1, word2) {
|
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(''));
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user