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