var temp = []; for(var i=0; i<arr1.length; i++){ temp.push(arr1[i]); } for(var i=0; i<arr2.length; i++){ temp.push(arr2[i]); } console.log('temp is now', temp); return temp; }