xIndexNatural method

int xIndexNatural(
  1. bool check(
    1. T
    )
)

Implementation

int xIndexNatural(bool Function(T) check) {
  for (int i = 0; i < length; i++) {
    if (check.call(this[i])) {
      return i;
    }
  }
  return -1;
}