Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

272
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!