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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -