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

99
Vistas
how to get an array out of a javascript proxy

Hi I was wondering if anyone knew how to get an array out of a proxy's target value in JavaScript. I have something like this :

Proxy :
  [[target]] : Array // the array I need to extract
  [[handler]] : Object 
  [[IsRevoked]] : false
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

If all you have is a reference to the proxy, there is no way (by default) for you to get the proxy's target. A specific proxy could provide a way (via one of its trap handlers, probably), but there is none by default.

about 4 years ago · Juan Pablo Isaza Denunciar

0

As an addition, you may get a copy of the target by spreading if the handler maps everything accordingly. But you can not get the original [[target]] object.

const proxy = new Proxy([1, 2, 3], {
  get(target, prop, receiver) {
    return target[prop];
  }
});

console.log([...proxy]);

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