General Iteration rule

As all of the previous symbols follow the same rules as the sum and product, we will write down a general rule (sometimes people might even define other symbols that work the same way!) and then tell you how these new symbols work.

For each iteration symbol we define an initial value vv and an operation op\operatorname{op} that combines that value with a term in the iteration to produce the new value. Here is a list of the so far discussed symbols:

Then the general code will look like this:

let v = ...

for(let i = 0; i <= n; i++){
    v = op(v,f(i));
}