5 if (!Array.prototype.findIndex) {
6 Object.defineProperty(Array.prototype,
'findIndex', {
7 value:
function(predicate) {
10 throw new TypeError(
'"this" is null or not defined');
16 var len = o.length >>> 0;
19 if (typeof predicate !==
'function') {
20 throw new TypeError(
'predicate must be a function');
24 var thisArg = arguments[1];
36 if (predicate.call(thisArg, kValue, k, o)) {
50 if (!Array.prototype.find) {
51 Object.defineProperty(Array.prototype,
'find', {
52 value:
function(predicate) {
55 throw new TypeError(
'"this" is null or not defined');
61 var len = o.length >>> 0;
64 if (typeof predicate !==
'function') {
65 throw new TypeError(
'predicate must be a function');
69 var thisArg = arguments[1];
81 if (predicate.call(thisArg, kValue, k, o)) {