What is the output?
void main() {
final a = [1, 2];
final b = [...a, 3];
b[0] = 9;
print(a[0] + b.length);
}
Try it in the online Dart Playground →
[spoiler title="Solution"]
Answer:
4
Explanation:
The spread copies values, so mutating b does not change a.
[/spoiler]