mm_expand 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +21 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2278,6 +2278,27 @@ if (typeof($) === "undefined") {
|
|
|
2278
2278
|
}
|
|
2279
2279
|
return newArr;
|
|
2280
2280
|
};
|
|
2281
|
+
|
|
2282
|
+
/**
|
|
2283
|
+
* 在数组指定位置插入对象
|
|
2284
|
+
* @param {Number} index 索引位置
|
|
2285
|
+
* @param {Object} obj 插入对象
|
|
2286
|
+
*/
|
|
2287
|
+
Array.prototype.insert = function(index, obj) {
|
|
2288
|
+
this.splice(index, 0, obj);
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
/**
|
|
2292
|
+
* 在数组指定位置插入数组的对象
|
|
2293
|
+
* @param {Number} index 索引位置
|
|
2294
|
+
* @param {Array} list 插入的对象数组
|
|
2295
|
+
*/
|
|
2296
|
+
Array.prototype.insertList = function(index, list) {
|
|
2297
|
+
for (var i = 0; i < list.length; i++) {
|
|
2298
|
+
var obj = list[i];
|
|
2299
|
+
this.insert(index, obj);
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2281
2302
|
})();
|
|
2282
2303
|
|
|
2283
2304
|
/**
|