Created
July 6, 2024 14:36
-
-
Save danywalls/9b2b504c5ef00c9658bf3a11e0010d1b to your computer and use it in GitHub Desktop.
isAnagram
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isAnagram(word: string, secondword: string): boolean { | |
const reversedWord = [...word].reverse().toString().replaceAll(',',"") | |
return secondword === reversedWord; | |
} | |
isAnagram('amor', 'roma') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment