360兼容模式ie10不支持includes方法

添加includes方法

if (!Array.prototype.includes) {
    Array.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;
        }
    };
}

 

posted @ 2021-05-11 17:25  颗就完了  阅读(245)  评论(0编辑  收藏  举报