js 重写concat

Array.prototype.concat = function(...arr) {
    var me = this;
    var tem = [];
    tem = me.slice(0);
    for (var i of arr) {
        tem.push(i);
    }
    return tem;
}
var t = [1, 2, 3];
var r = t.concat(1, 2);
原文地址:https://www.cnblogs.com/me-data/p/9860429.html