I have some variables in a loop which are different each iteration.
With those variables I want to fill a new object with some sub objects like so:
newProduct[key][prop][val] = "value";
What I want is an object like
car{ //key
color: { //prop
door: "value" //val + value
}
}
But my problem is that [val] is not an object from [prop] and that is what Node.JS is trying to do.
I have tried it some other brackets like [prop[val]] and [prop + "." + val], but that doesn't seems to work.
How can I get this to work?