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

132
Vistas
How to use forEach to check if there is a match in the array (JavaScript)

How to use forEach to check if there is a match in the array (JavaScript)

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

0

I'm not sure exactly what you're asking; how do you "log out" variables in code?

In general, you don't need a loop to check existence an array; that's what the Array.includes method is for:

if (files.includes(upload.type)) {
    console.log("type is OK")
} else {
    console.log(`type ${upload.type} not found`)
}
about 4 years ago · Juan Pablo Isaza Denunciar

0

const isMatch = files.some((type) => upload.type === type);

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