Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active November 28, 2022 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/d6655e5514450f0e3a58858e2f5c31db to your computer and use it in GitHub Desktop.
Save McLarenCollege/d6655e5514450f0e3a58858e2f5c31db to your computer and use it in GitHub Desktop.
Exercise : Anagrams Part 2

Write a function that accepts two strings and checks if the first string is an anagram of the second string. If they are anagrams it returns true, otherwise it returns false. The case(upper/lower) of the characters DOES NOT MATTER.

function checkAnagram(word1, word2){
 // write your code here
}
console.log(checkAnagram("silent", "liSten")); // true
console.log(checkAnagram("stressed", "DesertsS")); // true
console.log(checkAnagram("stresseD", "desseRts")); // true
console.log(checkAnagram("grab", "Bragz")); // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment