indexOf method

int indexOf(
  1. T element
)

Returns first index of element, or -1 if the collection does not contain element.

Implementation

int indexOf(T element) {
  if (this is KtList) return (this as KtList).indexOf(element);
  var index = 0;
  for (final item in iter) {
    if (element == item) return index;
    index++;
  }
  return -1;
}