Say I have these JavaScript objects:
questions = { name: "Age", options:[boy, girl, daddy]}
answers = {"Age" : 21, "boy" : "checked", daddy : "checked"}
So if I wanted to access the "Age" from the answers object, I would do:
x = answers.Age //21
But how can I do the same thing but instead using the values from the questions object?
x = answers.questions.name //problem
or
answers.questions.options[0] //problem
As you can see I am trying to use the value of questions.name ("Age") to access a property of answers (Age).
What's the right syntax or way?