pxt-calliope/docs/js/operators.md
2016-07-25 17:00:51 -04:00

30 lines
1.1 KiB
Markdown

## Operators
The following JavaScript operators are supported for the micro:bit.
### ~hint
Note that for the micro:bit all arithmetic is performed on integers, rather than floating point.
This also is true when simulating in the browser.
### ~
# Assignment, arithmetic and bitwise
* assignment operators - [read more](http://devdocs.io/javascript/operators/assignment_operators)
* arithmetic operators - [read more](http://devdocs.io/javascript/operators/arithmetic_operators)
* bitwise operators - [read more](http://devdocs.io/javascript/operators/bitwise_operators)
# Comparision and conditional
* comparison operators - [read more](http://devdocs.io/javascript/operators/comparison_operators)
* conditional operator - [read more](http://devdocs.io/javascript/operators/conditional_operator)
## More
* lambda functions `() => { ... }`
* array literals `[1, 2, 3]`
* strings, with a few common methods
* [string templates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) (`` `x is ${x}` ``)
### ~button /js/statements
NEXT: Statements
### ~