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

274
Vistas
How to extract multiple value from array of object and declare them as variable in javascript

I have a data like this from MySQL database

Log [
   logs {
     Values: {
       id: 20,
       OtherId: 1,
       status: 2,
       OtherStatus: 5,
       username: 'test1',
       num1: 10,
       num2: 5,
       string: '12345'
     },
    },
]

I need to able to access all values as variable for later use, i try to use map like

const id = Log.map(log => log.id)

it works, but i don't want to do declare them one by one, is there a way to declare them at once?

const id = Log.map(log => log.id)
const OtherId = Log.map(log => log.OtherId)
const status = Log.map(log => log.status)
.
.
.
about 4 years ago · Juan Pablo Isaza
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