compare function
Implementation
int compare(dynamic a, dynamic b) {
if (a is num && b is num) {
return a.compareTo(b);
} else if (a is String && b is String) {
return a.compareTo(b);
} else {
throw ArgumentError('Cannot compare $a and $b');
}
}