Answers for "javascript function to detect anagram counts in string array"

0

anagram javascript example

function anagram(name, words) {
	var a = name.replace(/\s/g,'').toLowerCase().split('').sort().join('');
	var b = words.join('').split('').sort().join('');
	return a == b;
}
Posted by: Guest on June-29-2020
0

anagram javascript example

function anagram(name, words) {
	name =  name.toLowerCase().split('').sort().join('').trim();
  words = words.join('').toLowerCase().split('').sort().join('');
  return name === words;
}
Posted by: Guest on June-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language