DEV Community

Valid Anagram

Stylus07 on April 11, 2022

Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearrangin...
Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited
const isAnagram = (s,t,f=i=>[...i].sort().join(''))=>f(s)==f(t)
const isAnagram = (s,t)=>''+[...s].sort()==[...t].sort()
Enter fullscreen mode Exit fullscreen mode

😝