Merge Two Arrays

Result

Also use "let data = [...data1, ...data2]"

To Visualize: Copy code and test Click Here

Code


      let data1 = [11,22,33,44,55]
      let data2 = [66,77,88,99]
      
      let data =[];

      for(let i=0; i<data1.length; i++){
        data[i]=data1[i];
      }

      for(let i=0; i<data2.length; i++){
        data[data1.length+i]=data2[i];
      }

      console.log(data)