feat: Soluciona o exercício 08 - Is anagram
This commit is contained in:
parent
3cdeba11dd
commit
2d18f109e1
@ -1,4 +1,11 @@
|
|||||||
export function isAnagram(word1, word2) {
|
export function isAnagram(word1, word2) {
|
||||||
// implementar logica aqui
|
// implementar logica aqui
|
||||||
|
word1 = word1.toUpperCase().split('').sort().join('')
|
||||||
|
word2 = word2.toUpperCase().split('').sort().join('')
|
||||||
|
|
||||||
|
if(word1 === word2){
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user