You are not recognized as the original poster of this topic.
Please familiarise yourself with the rules and markup syntax before posting.
iterate
function iterate(f,n,...a){for(let i=0;i<n-1;i++)f(...a);return f(...a);}
function iterate(f,n){for(let i=0;i<n-1;i++)f(i);return f(n-1);}