What does this print?
void main() {
String? name;
final result = name ?? 'Guest';
print(result);
}
Try it in the online Dart Playground →
[spoiler title="Solution"]
Answer:
Guest
Explanation:
The ?? operator returns the right operand when the left is null.
[/spoiler]