title: Javascript create new array object and assign new value
body: <pre><code>Hi I am getting problems to insert the marks in original array object from other array object.
  
  Sample Input:-
  </code></pre>
  <p>The length of array can be increase up to n limit but the marks array will be same as of sample input length</p>
  <pre><code>let arr = [[
      {&quot;name&quot;: 1, &quot;task&quot;: 1}
      {&quot;name&quot;: 1, &quot;task&quot;: 2}
      {&quot;name&quot;: 1, &quot;task&quot;: 8}
      {&quot;name&quot;: 1, &quot;task&quot;: 9}
      ],
      [
      {&quot;name&quot;: 1, &quot;task&quot;: 3}
      {&quot;name&quot;: 1, &quot;task&quot;: 5}
      {&quot;name&quot;: 1, &quot;task&quot;: 6}
      {&quot;name&quot;: 1, &quot;task&quot;: 7}
      ]
  ]
  
  I have to Insert the below listed marks in above object array as given in the output listed below after marksArr.
  
  let marksArr = [
      {marks: 1},
      {marks: 2}
      {marks: 3}
      {marks: 4}
      {marks: 5}
      {marks: 6}
      {marks: 7}
      {marks: 8}
  ]
  </code></pre>
  <p>I was creating it like result[i][j] = {} but it is always showing the error of undefined j. So I am not able to detect the problem.</p>
  <pre><code>Output Array Object
  
  let output = [[
      {&quot;name&quot;: 1, &quot;task&quot;: 1, &quot;marks&quot;: 1}
      {&quot;name&quot;: 1, &quot;task&quot;: 2, &quot;marks&quot;: 2}
      {&quot;name&quot;: 1, &quot;task&quot;: 8, &quot;marks&quot;: 3}
      {&quot;name&quot;: 1, &quot;task&quot;: 9, &quot;marks&quot;: 4}
      ],
      [
      {&quot;name&quot;: 1, &quot;task&quot;: 3, &quot;marks&quot;: 5}
      {&quot;name&quot;: 1, &quot;task&quot;: 5, &quot;marks&quot;: 6}
      {&quot;name&quot;: 1, &quot;task&quot;: 6, &quot;marks&quot;: 7}
      {&quot;name&quot;: 1, &quot;task&quot;: 7, &quot;marks&quot;: 8}
      ]
  ]
  </code></pre>
  <p>name, tasks already exists but I have to add the marks on the basis of marksArr. The sample output should have the structure given above in output object.</p>
  <p>I am sorry if there is any problem in the data</p>