/**
 * 由于部分低版本下的某些 app 可能会缺少某些原型方法, 这里增加兼容
 */ if ( ! String . prototype . includes ) { String . prototype . includes = function ( search , start ) { 'use strict' ; if ( typeof start !== 'number' ) { start = 0 ; } if ( start + search . length > this . length ) { return false ; } else { return this . indexOf ( search , start ) !== - 1 ; } } ; } if ( ! Array . prototype . find ) { Object . defineProperty ( Array . prototype , 'find' , { value : function ( predicate ) { if ( this == null ) { throw new TypeError ( '"this" is null or not defined' ) ; } var o = Object ( this ) ; var len = o . length >>> 0 ; if ( typeof predicate !== 'function' ) { throw new TypeError ( 'predicate must be a function' ) ; } var thisArg = arguments [ 1 ] ; var k = 0 ; while ( k < len ) { var kValue = o [ k ] ; if ( predicate . call ( thisArg , kValue , k , o ) ) { return kValue ; } k ++ ; } return void 0 ; } } ) ; }