Adds the specified number to the value currently assigned to a variable.
The value of the variable is set to the sum of its current value and the specified number. If the variable does not currently have a numerical value, the specified value will be assigned to the variable directly.
Read and run this code to see how changing a variable works.
These chicks spread quickly! Each time a chick is clicked, it increases the number of new chicks made by 2.
Name | Description |
---|---|
number | The amount to add to the value of the variable |
variable name | The name of the variable whose value is being changed |
Found a bug in the documentation? Let us know at documentation@code.org