The Recurse() function makes a recursive call of the defining function. For example, you can make a function to calculate factorials. A factorial is the product of a number, the number minus 1, the number minus 2, and so on, down to 1.
myfactorial = Function( {a},
If( a == 1,
1,
a * Recurse( a - 1 )
)
);
myfactorial( 5 );
120
You can define recursive calculations without using Recurse(). For example, you could replace Recurse() by myfactorial, and the script would still work. However, Recurse() offers these advantages: