1.4 KiB
1.4 KiB
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, to exit a loop before it has completed, usually used in conjunction with an if statement
- if conditional statement
- for and while loops
- function
- return
- var (local variable declaration)
Operators
TouchDevelop operators include:
- assignment operator
:=
(to update variables) - arithmetic operators (
+
,-
,*
,/
, mod) operate on Numbers - comparison operators (such as
>
,=
) operate on Numbers - boolean operators (
not
,or
,and
) operate on Booleans - concat operator combines Strings
Libraries
Libraries provide additional functions:
- the micro:bit library
- the math and bits libraries