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

86
Views
Vuejs returning with { ...}

Iam currently working with a project where project is almost partially completed. So I just saw a some weired code whihc I havent seen before and tried to find it via google and couldnt find anythig.

This is the code

methods:  {

getMap() {
   let A = this.$store.getters['MAP']
   let B = this.$store.getters['MAP2']

   return { ...A, ...B}
 }

}

What I really wants to know is

return { ...A, ...B}

what does it means ? any reference or any clarification please.

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

0

It's javascript spread syntax. What it does is merge two objects by keys, similar to Object.assign. For instance, in the following example, keys from A and B are merged into the final object with values from the latter object taking precedence.

const A = { a: 3, b: 4 }
const B = { c: 5, d: 7, a: 4 }

console.log({ ...A, ...B })

In your case, getMap return a combined object with key value pairs from Map and Map2 merged.

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!