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

1.2 KiB

statements, operators, and libaries

Statements, operators, and libraries.

@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:

see also

TouchDevelop Documentation, comments