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

166
Vistas
JavaScript every() on array of object doesn't loop through all the array

This is my code, I'm using this method to validate https request parameters. Logging the entries I see that just the first element of 2 is passed and therefore not all the values are checked. What am I missing?

    static validateParameters(req) {
        let params = Object.entries(req.query);

        return params.every(([key, value]) => {
          console.log(key, value);
          return value != undefined || value != ''
        });

    }

Edit The input to the function is a https request, the parameters would be in a 2d array

[
  [ 'ids', '' ],
  [ 'currencies', 'eur' ]
]

I believed the return value was undefined, but was actually an empty string. In any case changing || to && solved it.

about 4 years ago · Santiago Gelvez
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