0

I need to be able to set the member of an array using a variable, catch being that the variable defines the name of another arrays member. I'm writing in Typescript and ES6.

The code is passed an array as a variable e but the name of the text: key will be e.[variable].

What is the correct format for setting that variable member?

options.push(
    { key: e.Id, text: e.[variable] }
);

0 Answers0