I have a usercase where I get an array of functions from backend something like:
var arr = [A(){}, B(){}, C(){}];
Now I need a way to execute them such that each function in the array is passed as a parameter to another function in the array.
A(B(C()));
arr.reduceRight((p, c) => c(p), undefined);