Skip to content

Instantly share code, notes, and snippets.

@danywalls
Created July 6, 2024 14:36
Show Gist options
  • Save danywalls/9b2b504c5ef00c9658bf3a11e0010d1b to your computer and use it in GitHub Desktop.
Save danywalls/9b2b504c5ef00c9658bf3a11e0010d1b to your computer and use it in GitHub Desktop.
isAnagram
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