function findIndex()

in transforms/utils/array-polyfills.js [13:32]


function findIndex(predicate, context) {
  if (this == null) {
    throw new TypeError(
      'Array.prototype.findIndex called on null or undefined'
    );
  }
  if (typeof predicate !== 'function') {
    throw new TypeError('predicate must be a function');
  }
  var list = Object(this);
  /* eslint-disable no-bitwise */
  var length = list.length >>> 0;
  /* eslint-enable no-bitwise */
  for (var i = 0; i < length; i++) {
    if (predicate.call(context, list[i], i, list)) {
      return i;
    }
  }
  return -1;
}