What is the output?
void main() {
final nums = [1, 2, 3];
final out = [
for (var n in nums) n * 2
];
print(out.length + out[0]);
}
Try it in the online Dart Playground →
[spoiler title="Solution"]
Answer:
5
Explanation:
A collection for builds a new list by transforming each source item.
[/spoiler]