mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
Added fallback to native functions
This commit is contained in:
parent
066f665aac
commit
d0dfa37e50
@ -241,6 +241,9 @@ export default class Utils {
|
|||||||
static find(arr, predicate) {
|
static find(arr, predicate) {
|
||||||
let i;
|
let i;
|
||||||
let l;
|
let l;
|
||||||
|
if (Array.prototype.find) {
|
||||||
|
return Array.prototype.find.call(arr, predicate);
|
||||||
|
}
|
||||||
for (i = 0, l = arr.length; i < l; i++ ) {
|
for (i = 0, l = arr.length; i < l; i++ ) {
|
||||||
const value = arr[i];
|
const value = arr[i];
|
||||||
if (!predicate(value, i)) continue;
|
if (!predicate(value, i)) continue;
|
||||||
@ -259,6 +262,9 @@ export default class Utils {
|
|||||||
let i;
|
let i;
|
||||||
let l;
|
let l;
|
||||||
let k;
|
let k;
|
||||||
|
if (Object.assign) {
|
||||||
|
return Object.assign.apply(Object, arguments);
|
||||||
|
}
|
||||||
for (i = 1, l = arguments.length; i < l; i++) {
|
for (i = 1, l = arguments.length; i < l; i++) {
|
||||||
const assigner = arguments[i];
|
const assigner = arguments[i];
|
||||||
if (typeof assigner !== "object") continue;
|
if (typeof assigner !== "object") continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user