pxt-calliope/docs/reference/variables/assign.md
2016-03-25 16:47:20 -07:00

952 B

Assignment Operator

Set the value for local and global variables #docs #assignment #language #var #data

@parent blocks/operators

Set or change the value of a variable

let item = 0

Use the assignment operator to set or change the value of a variable.

Declare a variable

Declare a new local variable using the variable statement and the assignment operator. Like this:

let num1 = 42;
let name = "Joe";

The variable's name is on the left of the assignment operator and the variable's value is on the right:

let num1 = 42

Notes

  • You can use the assignment operator with variables of each of the supported types.

Lessons

rotation animation

See also

variable, types