42 lines
1.4 KiB
Markdown
42 lines
1.4 KiB
Markdown
|
# statements, operators, and libaries
|
||
|
|
||
|
Statements, operators, and libraries. #docs #statements #operators #library
|
||
|
|
||
|
### @parent js/language
|
||
|
|
||
|
|
||
|
TouchDevelop functions include statements and operators.
|
||
|
|
||
|
### Statements
|
||
|
|
||
|
TouchDevelop statements include:
|
||
|
|
||
|
* [break](/microbit/js/break), to exit a loop before it has completed, usually used in conjunction with an [if](/microbit/reference/logic/if) statement
|
||
|
* [if](/microbit/reference/logic/if) conditional statement
|
||
|
* [for](/microbit/reference/loops/for) and [while](/microbit/js/while) loops
|
||
|
* [function](/microbit/js/function)
|
||
|
* [return](/microbit/js/return)
|
||
|
* [var](/microbit/reference/variables/var) (local variable declaration)
|
||
|
|
||
|
### Operators
|
||
|
|
||
|
TouchDevelop operators include:
|
||
|
|
||
|
* [assignment operator](/microbit/reference/variables/assign) `:=` (to update variables)
|
||
|
* arithmetic operators (`+`, `-`, `*`, `/`, mod) operate on [Numbers](/microbit/reference/types/number)
|
||
|
* comparison operators (such as `>`, `=`) operate on [Numbers](/microbit/reference/types/number)
|
||
|
* boolean operators (`not`, `or`, `and`) operate on [Booleans](/microbit/reference/types/boolean)
|
||
|
* concat operator combines [Strings](/microbit/reference/types/string)
|
||
|
|
||
|
### Libraries
|
||
|
|
||
|
Libraries provide additional functions:
|
||
|
|
||
|
* the [micro:bit library](/microbit/js/contents)
|
||
|
* the [math](/microbit/js/math) and [bits](/microbit/js/bits) libraries
|
||
|
|
||
|
### see also
|
||
|
|
||
|
[TouchDevelop Documentation](/microbit/js/contents), [comments](/microbit/js/comment)
|
||
|
|