I defined a variable which will get user's input:
var input = USER_INPUT;
then, I create an object which will use this input
as an variable name inside the object:
var obj = { input: Car.newCar(...)}
Then, I try to access the obj[input]
, but it returns to me undefined. Is it so that in javascript, I can not use variable as an object's variable name?
If I would like to define a object which has vary variable name and variable value, how can I do?