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

146
Views
How to merge or append the array of objects to another array of object in JavaScript

How to merge the array of objects to another array of objects in JavaScript

Hi everyone, below I added my code.

   

    var person=[{"name":"Billy","age":34},{"name":"Billy","age":34}];
       var clothing=[{"shoes":"nike","shirt":"long sleeve"}, 
       {"shoes":"nike","shirt":"long sleeve"}];

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

0

you can use spread operator for this

const merged = [...person,...clothing]
about 4 years ago · Juan Pablo Isaza Report

0

Use spread ES6 syntax https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Operators/Spread_syntax

var person=[{"name":"Billy","age":34},{"name":"Billy","age":34}];
var clothing=[{"shoes":"nike","shirt":"long sleeve"},{"shoes":"nike","shirt":"long sleeve"}];

var merge = [...person, ...clothing]
console.log(merge)

about 4 years ago · Juan Pablo Isaza Report

0

var person=[{"name":"Billy","age":34},{"name":"Billy","age":34}];
var clothing=[{"shoes":"nike","shirt":"long sleeve"},{"shoes":"nike","shirt":"long sleeve"}];


var mergedV1 = [...person, ...clothing]
var mergedV2 = person.concat(clothing)
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!