Created
February 6, 2022 01:14
-
-
Save tofikhidayatxyz/3081eae0460243214c8db8ac6f433e0b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const firsVal = 'harum' | |
| const secondVal = 'rumah' | |
| const isAnagram = (firstVal, secondVal) => { | |
| firstVal = firstVal | |
| .toLowerCase() | |
| .split(' ') | |
| .join('') | |
| .split('') | |
| .sort() | |
| .join('') | |
| secondVal = secondVal | |
| .toLowerCase() | |
| .split(' ') | |
| .join('') | |
| .split('') | |
| .sort() | |
| .join('') | |
| return firstVal == secondVal | |
| } | |
| console.log(isAnagram(firsVal, secondVal)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment