I am trying to pass sns topic when creating a message. But depending on the variable that was created, the arn can differ.
So for example in the env variables i will have lets say 3 people and their topics.
john = arn:xxxxxxxx
sally= arn:xxxxxxxx
bill= arn:xxxxxxxx
Now depending on another logic, it will output var thisvariable="john".
Then I would like to take that variable and pass it into process.env, so it looks something like process.env.thisvariable.
How can I do this properly?
Just like with any property of any object in JavaScript you can access them like this, if you know the property name:
thing.other.propertyName
Or you can access them like this if the property name is calculated or obtained during run-time:
const propNameVar = 'myProperty';
thing.other[propNameVar]
This would be the same as:
thing.other.myProperty;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.