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

226
Views
JavaScript: Convert array to object without key or string

I have an array like [1,2,3,4,5]. I want to convert it to object like {1,2,3,4,5} or 1,2,3,4,5.

I would be thankful if someone helps me.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

for 1,2,3,4,5, you just have to use .join()

const arr = [1,2,3,4,5]
console.log(arr.join())

Also, specifically for query parameters, in browser or Node, you could use URLSearchParams, which helps you define your query object

const obj = { a: [1,2,3,4,5] }
const searchParams = new URLSearchParams(obj).toString();

console.log(searchParams)

about 4 years ago · Juan Pablo Isaza 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!