Answer the question
In order to leave comments, you need to log in
Object doesn't support property or method 'find'?
Hello, in IE9-11 this error pops up. On the project I use wepback + babel.
An error like this pops up
Object doesn't support property or method 'find'
var row = father.processedSmartBody.find(byId(id));
Answer the question
In order to leave comments, you need to log in
1) maybe you have an object, not an array
2) there is no such method in IE. Connect babel-polyfill either separately
if (!Array.prototype.find) {
Array.prototype.find = function(predicate) {
if (this == null) {
throw new TypeError('Array.prototype.find called on null or undefined');
}
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function');
}
var list = Object(this);
var length = list.length >>> 0;
var thisArg = arguments[1];
var value;
for (var i = 0; i < length; i++) {
value = list[i];
if (predicate.call(thisArg, value, i, list)) {
return value;
}
}
return undefined;
};
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question