On CodePen, I'm trying to filter out the restaurants that start with the letter 'c' but I got an error that says 'errorTypeError: c.includes is not a function' but I already checked spelling and see if they're named the same as the ID. am I supposed to put the callback function in the 'result.forEach(restaurant => {
cList += \n${restaurant.name};
});' line, or is it something else?
c is a restaurant, i.e. an object of the form { name, takeout, rating }. It doesn't have a method includes.
Most likely, you intended to call includes on the string property name: c.name.includes('c').
Note that your code says "Restaurants that start with a C" but that's not what this code would do even after the fix - it would look for restaurants whose names have a lower-case c anywhere in the name. I guess you rather want something like c.name.startsWith('C') or even c.name.match(/^c/i) in case it should allow both lower- and upper-case C.
You would have noticed that if you had debugged your code. Please familiarize yourself with how to debug JavaScript using the browser devtools to be able to identify and solve such issues yourself next time.