Insert an array in another array

by Mohan 2012-09-20 23:41:32


Insert an array in another array
var a = [1,2,3,7,8,9]

var b = [4,5,6]
var insertIndex = 3;

a.splice.apply(a, Array.concat(insertIndex, 0, b));
Print(a); // prints: 1,2,3,4,5,6,7,8,9
________________________________________


1078
like
0
dislike
0
mail
flag

You must LOGIN to add comments