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

296
Vistas
How to access typescript object property from a string?

In typescript I have this object of type "Eular" (from three.js library). The object has 3 properties I can access x, y, z, like this

obj.z = 1;

But suppose I have this now

var key = "z";

How can I access the z property from using the variable key?

This doesn't work

obj[key] = 1;

I get this

Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Euler'.
  No index signature with a parameter of type 'string' was found on type 'Euler'.ts(7053)

Thanks

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