Tri,
function getCharCount(str, char) {
let counter = 0;
str = str.toLowerCase();
char = char.toLowerCase();
for (let letter of str) counter += letter == char
return counter
}
alert(getCharCount("ААААаааа", "а"));
alert(getCharCount("строка", "с"));
alert(getCharCount("строка", "ы"));