Skip to content

Instantly share code, notes, and snippets.

@damondouglas
Created July 4, 2013 18:17
Show Gist options
  • Save damondouglas/5929472 to your computer and use it in GitHub Desktop.
Save damondouglas/5929472 to your computer and use it in GitHub Desktop.
Nested ? and : in Dart
void main() {
var a = 0;
var b = 2;
var c =
a == 0 ?
b == 0 ? 0 : 1
: 2;
print(c); // prints 1
}
@damondouglas
Copy link
Author

Copy and paste into http://try.dartlang.org/ to try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment