Created
July 4, 2013 18:17
-
-
Save damondouglas/5929472 to your computer and use it in GitHub Desktop.
Nested ? and : in Dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
var a = 0; | |
var b = 2; | |
var c = | |
a == 0 ? | |
b == 0 ? 0 : 1 | |
: 2; | |
print(c); // prints 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy and paste into http://try.dartlang.org/ to try it out.