Let me show you an example of what I want to accomplish:
Say I want to call a functions sub function's sub function's sub function (and so on, lets say for 50+ sub functions), like:
foo(arg).bar(other).foobar(int, str).execute(str)
and imagine that there are 50+ sub functions, so it would be pretty impractical to type out each sub-call.
SO: How do I write a function to call the sub-function of the sub-function etc... (based on the array length)?, based on an array like this (for example):
[["foo",["asdf"]],["bar",["other"]],["foobar",[123,"hi"]],["execute",["today"]]]
To be clear, I'm NOT simply trying to call a each function in the array individually with the corresponding parameters, I could do that easily with:
arr.forEach(x=>functionDictionary(x[0])(...x[1])
I want to simply get this:
foo(arg).bar(other).foobar(int, str).execute(str)
from this:
[["foo",["asdf"]],["bar",["other"]],["foobar",[123,"hi"]],["execute",["today"]]]