I want to access the value of my object but with a .var
.
For example, if I specifiy the full path by myself it's apple = theApples.trees.green
but I want to do:
var colorOfApple = "red";
apple = theApples.trees.colorOfApple;
the problem is it tries to access .colorOfApple
of the object but I want to have the value of colorOfApple