I tried the following code in IE9, Chrome. But it is not working in both browsers.
In Firefox, it is working fine
<script type="text/javascript">
var first = ['a','b','c','h','i','j'];
var second = ['d','e','f','g'];
var insertPosIndex = 3;
first.splice.apply(first, Array.concat(insertPosIndex, 0, second));
alert(first);
</script>
I am expecting the output as a,b,c,d,e,f,g,h,i,j
According to a bug, read about it here using
[]instead ofArrayis the work around for Chrome.This will work in Firefox, IE9 and Chrome.