This visionary Dart program contains zero errors and warnings. This code has no associated html or css.
Created with <3 with dartpad.dartlang.org.
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'); | |
} |