I'm building a program in React that is basically a questionnaire / survey, so far I've got users answering a bunch of questions then what I am trying to do is take the answers, filter them a bit then return an object to store using Redux. Each question is an object it self that holds different factors than I am trying to measure. Although, I'm getting stuck with actually trying to create the structure of the final object.
I want the object to look something like this:
Results {
Question1 {
factor1: 1,
factor2: 2,
factor3: 3
},
Question2 {
factor1: 3,
factor2: 6
},
and so on...
}
But when I try create create it by saying for example
let results = {
Question1 {
factor1: 0
}
}
React doesn't like it. As soon as I try nest another object inside it returns an error.. Am I missing something simple or do I need to try another approach, any help would be appreciated