WLJS LogoWLJS Notebook

AddTo

x += dx adds dx to x and returns the new value of x.

Examples

Increment a variable by a value:

x = 5;
x += 3
(* 8 *)

Accumulate values in a loop:

total = 0;
Do[total += i, {i, 5}];
total
(* 15 *)

Please visit the official Wolfram Language Reference for more details.

On this page