2016-07-25 22:53:33 +02:00
|
|
|
## Operators
|
|
|
|
|
|
|
|
The following JavaScript operators are supported for the micro:bit.
|
2016-07-25 23:00:51 +02:00
|
|
|
|
|
|
|
### ~hint
|
2016-07-25 22:53:33 +02:00
|
|
|
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.
|
2016-07-25 23:00:51 +02:00
|
|
|
### ~
|
2016-07-25 22:53:33 +02:00
|
|
|
|
|
|
|
# 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}` ``)
|
|
|
|
|
2016-07-25 23:00:51 +02:00
|
|
|
### ~button /js/statements
|
|
|
|
NEXT: Statements
|
2016-07-25 22:53:33 +02:00
|
|
|
### ~
|