I have the following array
var testArray = ["test1", "test2", "test3"];
and an obj which has other object in it
var obj.test1.test2.test3 = "test";
I want to foreach the testArray
and get the following
obj[testArray[0]][testArray[1]][testArray[2]]
or obj["test1"]["test2"]["test3"]
which is equal to obj.test1.test2.test3 and will return "test"