A
agendum97
MSDN says splice has the following arguments:
arrayObj.splice(start, deleteCount, [item1[, item2[, . . .
[,itemN]]]])
Thus I can insert items into an array using splice. But how do I
insert an entire array? For example:
var arr1 = [];
arr1[0] = "a";
arr2[1] = "d";
var arr2 = [];
arr2[0] = "b";
arr2[1] = "c";
arr1.splice(1, 0, arr2);
Because array arguments in splice dont work like they do in concat,
this expectedly yeilds this for arr1: a,[b,c],d
Without having to use slice and concat which allocates up to three new
arrays, is there anyway to splice one array into another?
Thanks
arrayObj.splice(start, deleteCount, [item1[, item2[, . . .
[,itemN]]]])
Thus I can insert items into an array using splice. But how do I
insert an entire array? For example:
var arr1 = [];
arr1[0] = "a";
arr2[1] = "d";
var arr2 = [];
arr2[0] = "b";
arr2[1] = "c";
arr1.splice(1, 0, arr2);
Because array arguments in splice dont work like they do in concat,
this expectedly yeilds this for arr1: a,[b,c],d
Without having to use slice and concat which allocates up to three new
arrays, is there anyway to splice one array into another?
Thanks