title: 2-dimensional array to object (JavaScript)
body: <p>I have an array, that holds a large number of two-dimensional arrays:</p>
  
  <pre><code>var myArray = [
      [2260146,2334221,"copy"],
      [1226218,2334231,"copy"],
      [2230932,-1,"copy"],
      [2230933,-1,"copy"],
      [2230934,-1,"copy"]
  ]
  </code></pre>
  
  <p>I need to convert this array into an object of the following form to send it as JSON:</p>
  
  <pre><code>var json = [
    {
      "s_id": 2260146,
      "t_id": 2334221,
      "type": "copy"
    },
    {
      "s_id": 1226218,
      "t_id": 2334231,
      "type": "copy"
    },
    {
      "s_id": 12,
      "t_id": -1,
      "type": "copy"
    }
  ]
  </code></pre>
  
  <p>("s_id" should be <code>myArray[0][0]</code>, "t_id <code>myArray[0][1]</code>, and "type" <code>myArray[0][2]</code> and so on.)</p>
  
  <p>How can I get the array in the desired form? Thanks in advance.</p>