UNPKG

pxt-core-own

Version:

Microsoft MakeCode, also known as Programming Experience Toolkit (PXT), provides Blocks / JavaScript tools and editors

30 lines (22 loc) 727 B
# Change value Change, meaning increase, the value of a variable by some amount. ```block let x = 0 x += 2 ``` The change blocks increase the value in the variable by the amount you want. This is also known as an _addition assignment_ operation. ### Change a declared variable Use the change operator to set a new, larger value to a [variable](/blocks/variables/var). If you **`let`** a variable have a value of `1`, the change block makes the value change by `2` like this: ```block let x = 1 x += 2 ``` ### ~ hint You can use the change operator with variables of each of the supported [types](/types). ### ~ ## #examples ## See also [Variables](/blocks/variables/var), [Assignment operator](/blocks/variables/assign)