i have arrays like this: ['req','changepage']
or like this: ['dashboard','draw','ovreview']
the result i need is:
mainObject.req.changepage()
and
mainObject.dashboard.draw.overview()
I know that i can do:
mainObject.[array[0]].[array[1]]()
but the length of the array may vary... how to do that programatically?