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

249
Vistas
Javascript bug (object value changes unexpectedly)

I encountered a bug in Javascript that took me hours to realize. The way I see it logically: The object after receiving the value had nothing to do with the array but it changes as the array changes. Please explain the interaction, I am new to Javascript. Thank you so much!

const x = [[1,5],[2],[3]];
const y = {change:[]};
y.change.unshift(x[0]);
console.log(y); //{ change: [ [ 1, 5 ] ] }
x[0][1] = 10;
console.log(y); // { change: [ [ 1, 10 ] ] }

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