pxt-calliope/olddocs/js/statements.md
2016-11-01 17:44:37 -07:00

42 lines
1.2 KiB
Markdown

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