pxt-calliope/docs/js/operators.md

27 lines
1.0 KiB
Markdown
Raw Normal View History

## Operators
The following JavaScript operators are supported for the micro:bit.
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/controlflow
NEXT: Control Flow
### ~