void main() {
var numbers = [5, 10, -4, 27, -8, 6, -2];
print("Ascending Order");
numbers.sort((i, j) => i - j);
numbers.forEach((i) => {print(i)});
}
Output
Ascending Order
-8
-4
-2
5
6
10
27
void main() {
var numbers = [5, 10, -4, 27, -8, 6, -2];
print("Ascending Order");
numbers.sort((i, j) => i - j);
numbers.forEach((i) => {print(i)});
}
Ascending Order
-8
-4
-2
5
6
10
27