arrayMin<T extends num> function

T? arrayMin<T extends num>(
  1. List<T> array
)

Implementation

T? arrayMin<T extends num>(List<T> array) {
  if (array.isEmpty) return null; //return 9999999;

  var min = array[0];

  for (var i = 1, l = array.length; i < l; ++i) {
    if (array[i] < min) min = array[i];
  }

  return min;
}