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