'use strict';module.exports=function(arr,predicate,ctx){if(typeofArray.prototype.findIndex==='function'){returnarr.findIndex(predicate,ctx);}if(typeofpredicate!=='function'){thrownewTypeError('predicate must be a function');}varlist=Object(arr);varlen=list.length;if(len===0){return-1;}for(vari=0;i<len;i++){if(predicate.call(ctx,list[i],i,list)){returni;}}return-1;};