iterate-function

Repeatedly apply a function.

iterate-function

Repeatedly apply 'f' to 'val'

For example, the powers of 2:

power = iterate(4, 1, function(n) { return n * 2 });
> 16