javascript - Retrieving the variable value to act as a name -
this question has answer here:
i need object in typescript declared this:
queryparameters = { flagged: true };
now have flagged
retrieved variable name. like:
var param = 'flagged'; queryparameters = { valueof(param): true };
any idea ?
thanks.
why not use computed property names:
queryparameters = { [param]: true };
Comments
Post a Comment