Links
- Chapter 2: Operators
- Operators and their precedence
- Overridable Operators
- Arithmetic | Equality/Relational | Type Test/Cast | Logical | Bitwise | Other
- There is no operator to raise a number to an exponent. Use math:pow for that
Snippets
Cascade operator: ..
Use the cascade operator (..) when you want to perform a series of operations on the members of a single object:
query('#button') ..text = 'Click to Confirm' // Get an object. Use its ..classes.add('important') // instance variables ..onClick.listen((e) => window.alert('Confirmed!')); // and methods.
Integer division operator: ~/
assert(5 ~/ 2 == 2); // Result is an integer