Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
did i mix up the function names with id's i got this errorTypeError: c.includes is not a function

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?

https://codepen.io/tizum5/pen/qBXVmLb?editors=0011

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

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.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda