title: How to convert an array of key-value tuples into an object
body: <p>I have an array: </p>
  
  <pre><code>[ [ 'cardType', 'iDEBIT' ],
    [ 'txnAmount', '17.64' ],
    [ 'txnId', '20181' ],
    [ 'txnType', 'Purchase' ],
    [ 'txnDate', '2015/08/13 21:50:04' ],
    [ 'respCode', '0' ],
    [ 'isoCode', '0' ],
    [ 'authCode', '' ],
    [ 'acquirerInvoice', '0' ],
    [ 'message', '' ],
    [ 'isComplete', 'true' ],
    [ 'isTimeout', 'false' ] ]
  </code></pre>
  
  <p>But I can't access data via an array's key, e.g. <code>arr['txnId']</code> does not return <code>20181</code>. How can I convert the above array of tuples into an object, so that I can easily access data by key.</p>