What does this print?
void main() {
final ok = true;
final nums = [
1,
if (ok) 2,
3,
];
print(nums.length);
}
Try it in the online Dart Playground →
[spoiler title="Solution"]
Answer:
3
Explanation:
Collection if conditionally includes elements in list literals.
[/spoiler]