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

193
Vistas
What does export const { x: y} = z; do?

I'm really confused by the following statement in an index.ts:

import z from 'path/to/z';
export const { x: y } = z;

What does the second line actually export and how does the value of z correlate with it? Also, what purpose does this kind of export serve?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This is an export declaration with a const destructuring pattern. y is the variable being declared, which is initialised with the x property of z.

It could (and perhaps should) be written as the equivalent

export const y = z.x;
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