Sort()
- A sort() method is used to sort the elements of an iterable in ascending order.
Example
void main() {
var numbers = [1, 2, 3, 4, 1, 4, 2, 5, 6, 1, 3, 5, 3];
numbers.sort();
print(numbers);
}
Output
[1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6]
Exited.