Home

Published

- 1 min read

javascript anagram check

img of javascript  anagram check

The solution for this is noted below

javascript anagram check

Solution

   const areAnagram = (str1, str2) =>
	str1.toLowerCase().split('').sort().join('') === str2.toLowerCase().split('').sort().join('')

// Examples
areAnagram('listen', 'silent') // true
areAnagram('they see', 'the eyes') // true
areAnagram('node', 'deno') // true

Try other methods by searching on the site. That is if this doesn’t work