← Back to challenges

Check for Anagrams

JavaScriptHardstringsmathvalidationinterview

Instructions

Create a function that takes two strings and returns either true or false depending on whether they're anagrams or not.

Examples

isAnagram("cristian", "Cristina") ➞ true

isAnagram("Dave Barry", "Ray Adverb") ➞ true

isAnagram("Nope", "Note") ➞ false

Notes

  • Should be case insensitive.
  • The two given strings can be of different lengths.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Remove the Special Characters from a String