2022-10-27 15:07:13 +00:00
|
|
|
export function isAnagram(word1, word2) {
|
|
|
|
|
2022-10-28 21:24:03 +00:00
|
|
|
let palavra1 = word1.toLowerCase().split('').sort().join('');
|
2022-10-29 02:52:50 +00:00
|
|
|
let palavra2 = word2.toLowerCase().split('').sort().join('');
|
2022-10-28 21:24:03 +00:00
|
|
|
|
|
|
|
return (palavra1 === palavra2);
|
|
|
|
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|