Tsallaka zuwa abun ciki
Justice Tech School

Lists

Lists are ordered and growable. Use add, insert, remove, length and index access.

Example
var a = [3, 1, 2];
a.add(4);
a.insert(0, 9);
a.remove(1);
print(a);
print("${a.length} ${a.first} ${a.last}");
a.sort();
print(a);

Exercise

Add an item.

a.(5)

Quiz Test

Are Dart lists zero based?

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