i tried to push an array to other array in specific order with this javascript code :
var arr1=["A","B","C","D","E","F"];
var arr2=["1","2","3"]
console.log(arr1.splice(0,-1,arr2));
its reutn [];
my desire rusult : ["1","2","3","A","B","C","D","F"]
please any body show me how to achieve my desire result with splice function ps : i can achieve this with loop
Thx
EDIT: sorry, My question was misleading. This is my actual condition:
arr1 :[["A","B","C"],["D","E","F"]]
arr2 :["1","2","3"]
Expected output : [["1,"2","3","A","B","C"],["1","2","3","D","E","F"]]
I have tried:
arr1.map(function(e) {
return e.splice(0, -1, arra2)
});
but I got: [],[]