Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

91
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda