Answers for "how to find anagram using javascript"

5

javascript anagram check

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
Posted by: Guest on July-03-2020
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

Code answers related to "Javascript"

Browse Popular Code Answers by Language