No, you need to define a property in your js object - i.e. property-name.
What can be done the other way around: you can call a JS object with a name.
For instance:
var propName = "prop"; var prop = "value"; console.log(window[propName])
Edit: Have you ever visited a library like Backbone or KnockoutJS? I'm not sure what you are doing, but I think that you are building the functionality that these libraries already provide ...
source share