Skip to content

Instantly share code, notes, and snippets.

Created August 19, 2015 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9de887c4daf76d39e524 to your computer and use it in GitHub Desktop.
Save anonymous/9de887c4daf76d39e524 to your computer and use it in GitHub Desktop.
bitter-dawn-5945

bitter-dawn-5945

This visionary Dart program contains zero errors and warnings. This code has no associated html or css.

Created with <3 with dartpad.dartlang.org.

void main() {
assignValues(0, 0, 1);
assignValues(null, null, 1);
}
assignValues(int a, int b, int value) {
print('// a: $a, b: $b');
print('a = $value; b ??= $value');
a = value; // assign always
b ??= value; // assign iff b is null
print('a is $a; b is $b\n');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment