I have a small issue with understanding why I'm getting this output.
var arr = ["a", "b", "c", "d", "e", "f"];
arr.splice(2,0,"1");
console.log(arr);
var arr2 = ["a", "b", "c", "d", "e", "f"];
arr2 = arr2.splice(2,0,"2");
console.log(arr2);
ouput is:
[ 'a', 'b', '1', 'c', 'd', 'e', 'f' ]
[]
Why is the second line of output not:
[ 'a', 'b', '2', 'c', 'd', 'e', 'f' ]
Is it an issue of assignment or what?