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

125
Vistas
How do i get the total count of data objects in this API response

Im trying to write a code that retrieves data from a db and verifies if its matches the data that is synced in an online tool For that i need to know the number of ROWS created in the db table for comparison. A table is created for each entry and it goes something like this:

type: list
data: [ 
       {count 1},
       {count 2},
       {count 3}
       ]

now i need to get the number of "counts" in this object (which is 3 in this example). Some API's have a total_count tag which is helpul in getting me my info. but others dont. Anyway i can get that number?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

If your Response is allways in an Array use Array.length

let apiRes = {data: [1,2,3]};
console.log(apiRes.data.length);

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