Tell us what’s happening:
I’m trying Step 8. The instructions (and error) say I should create an empty for…of loop that iterates over each word in sentence. I thought that is what my code is doing. Please advise
Your code so far
function printCharacters(str) {
for (const char of str) {
console.log(char);
}
}
printCharacters("hello");
function getMatchedWordCount(sentence, match) {
let count = 0;
// User Editable Region
for (const word of sentence) {
};
// User Editable Region
return count;
}
console.log(
getMatchedWordCount(
["I", "really", "really", "really", "like", "to", "code"],
"really"
)
);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0
Challenge Information:
Build a Word Counter - Step 8