Inspired by this tweet from the always awesome Fermat's Library.
Challenge
In the language of your choice, write a script that will determine if two strings are an anagram for each other. You can use the approach outlined in the tweet, or — for bonus points — come up with your own solution 🤓.
Via Wikipedia:
An anagram is word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
For our challenge, we'll use the strict definition — each letter must be used exactly once.
Expected Behavior:
isAnagram(stressed, desserts) // TRUE
isAnagram(happy, sad) // FALSE
Have fun!