Skip to content
Justice Tech School

Spread Operators

... spreads a collection into another. ...? spreads a nullable one.

Example
var a = [1, 2];
var b = [0, ...a, 3];
List<int>? maybe;
var c = [...b, ...?maybe];
print(b);
print(c);

Exercise

Spread.

[0, a]

Quiz Test

What does ...? do?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.