moving out outdated js docs

This commit is contained in:
Peli de Halleux
2016-04-15 14:37:25 -07:00
parent 6515cc0360
commit bb6ae00a49
153 changed files with 0 additions and 81 deletions

54
olddocs/js/assign.md Normal file
View File

@@ -0,0 +1,54 @@
# Assignment Operator
Set the value for local and global variables.
### @parent js/operators
Set or change the value of a variable
### Block Editor
![](/static/mb/antenna-0.png)
### Touch Develop
Use the assignment operator (:=) to set or change the value of a [local variable](/reference/variables/var) or a [global variable](/js/data).
### Declare a variable
Declare a new *local* variable using the [var](/reference/variables/var) statement and the assignment operator (`:=`). Like this:
```blocks
let num1 = 7
let name = "Joe"
```
The variable's name is on the left of the assignment operator (`:=`) and the variable's value is on the right:
*variable name* `:=` *value*
See [global variable](/js/data) for info on declaring a global variable.
### Change a variable
After a global or local variable is defined, use the assignment operator (`:=`) to change the variable's value.
```
g = 42
num1 = 42
```
### Notes
* Don't confuse the assignment operator `:=` with the equality operator `=`, which is used to compare values.
* You can use the assignment operator `:=` with variables of each of the supported [types](/js/types).
### Lessons
[counter](/lessons/counter), [rotation animation](/lessons/rotation-animation), [digital pet](/lessons/digital-pet), [offset image](/lessons/offset-image)
### See also
[local variables](/reference/variables/var), [global variables](/js/data), [types](/js/types)