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

116
Views
Convert an array of Object's specific key Values to Comma-Separated String

How do we Convert an Object's specific key Values to Comma-Separated String , I can convert when it is an array but my issue is that my data is an array of objects , so I wanna convert every id to an array of strings like an example below.

#current code - just initial idea

console.log(['a', 'b', 'c'].join(','));

#example object

data = [
    {
        "id": 496,
    },
    {
        "id": 381,
    }
]

#expected result

  '496,381'
almost 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can simply map the items of your array of objects, to extract the value of their id key:

The map() method creates a new array populated with the results of calling a provided function on every element in the calling array.

data.map(item => item.id).join()
almost 4 years ago · Santiago Trujillo Report
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!