forked from M3-Academy/challenge-algorithms-v2.0
feat: finalizado isAnagram
This commit is contained in:
parent
42f653c394
commit
302ca997f6
@ -1,4 +1,8 @@
|
|||||||
export function isAnagram(word1, word2) {
|
export function isAnagram(word1, word2) {
|
||||||
// implementar logica aqui
|
// implementar logica aqui
|
||||||
|
word1 = word1.toLowerCase().split('').sort().join('');
|
||||||
|
word2 = word2.toLowerCase().split('').sort().join('');
|
||||||
|
|
||||||
|
if(word1 == word2) return true;
|
||||||
|
return false;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user