📅  最后修改于: 2022-03-11 15:04:06.448000             🧑  作者: Mango
function countInstancesOf(letter, sentence) {
var count = 0;
for (var i = 0; i < sentence.length; i++) {
if (sentence.charAt(i) === letter) {
count += 1;
}
}
return count;
}