Why this error occurs on mobile browsers (screenshot attached)?

A function that adds a propery array in js that allows you to find objects by key. In all desktop browsers it works, in the built-in Android and in Safari and chrome on iPad not working. Debugging that showed. What's wrong with this code?

Object.defineProperty(Array.prototype, "getItemByKey", {
 value: function getItemByKey(key, value) {
 var res = this.filter(_ => _[key] === value)[0];
 return res;
}
});

Here is what the debugger in chrome, when connecting Android device

8456e47c8a9848e3a25c64038d35a160.png
July 12th 19 at 16:55
2 answers
July 12th 19 at 16:57
Solution
Generally understood. It turns out that the lambda expression (which in js are called "arrow functions"), they were added to the ECMA-2015, and is supported in few places

Read more here https://developer.mozilla.org/ru/docs/Web/JavaScri...

Instead, use simple functions

Object.defineProperty(Array.prototype, "getItemByKey", {
 value: function getItemByKey(key, value) {
 var res = this.filter(function(_) { return _[key] === value })[0];
 return res;
}
});
July 12th 19 at 16:59
Babel to help

Find more questions by tags JavaScript