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

142
Vistas
what is the use of adding triple dot in array in javascript?

What is the use of adding triple dots in an array in javascript?

my code sample is:

let array = [newArray]

and

let array = [...newArray]*
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Adding triple dots on an array is called spread syntax

By using it like this newArray = [...existingArray], we spread the existingArray into newArray so newArray has all the items of existingArray now.

Common use case of this syntax is to add new items into a new array with the existing items from another array

const oldArr = [2,3,4];
const newArr = [1,...oldArr]; //newArr = [1,2,3,4]

//If you put it like this..
const oldArr = [2,3,4];
const newArr = [oldArr]; //newArr = [[2,3,4]]

See this for more info : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax

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