pxt-calliope/docs/reference/js/statements.md

42 lines
1.2 KiB
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# statements, operators, and libaries
2016-04-02 01:22:47 +02:00
Statements, operators, and libraries.
2016-03-26 00:47:20 +01:00
### @parent js/language
TouchDevelop functions include statements and operators.
### Statements
TouchDevelop statements include:
2016-04-13 17:27:45 +02:00
* [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)
2016-03-26 00:47:20 +01:00
### Operators
TouchDevelop operators include:
2016-04-13 17:27:45 +02:00
* [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)
2016-03-26 00:47:20 +01:00
### Libraries
Libraries provide additional functions:
2016-04-13 17:27:45 +02:00
* the [micro:bit library](/js/contents)
* the [math](/js/math) and [bits](/js/bits) libraries
2016-03-26 00:47:20 +01:00
### see also
2016-04-13 17:27:45 +02:00
[TouchDevelop Documentation](/js/contents), [comments](/js/comment)
2016-03-26 00:47:20 +01:00