Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

dart null aware operator ??

print(1 ?? 3); // <-- Prints 1.
print(null ?? 12); // <-- Prints 12.

int a; // The initial value of a is null.
a ??= 3;
print(a); // <-- Prints 3.

a ??= 5;
print(a); // <-- Still prints 3.
 
PREVIOUS NEXT
Tagged: #dart #null #aware #operator
ADD COMMENT
Topic
Name
2+1 =