Javascript: access to an object's member by name -


i have object called themesdata:

var themesdata = {} themesdata.a = { key: "value" };  themesdata.b = { key: "another value"}; 

...and want access 1 of members name. string contains either "a" or "b" , want appropriate member's value.

i'd happy on that.

themesdata["a"].key need , equivalent themesdata.a.key, still "array index style" notation allows dynamically generate index names.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -