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