I have an array:
[ [ \'cardType\', \'iDEBIT\' ], [ \'txnAmount\', \'17.64\' ], [ \'txnId\', \'20181\' ], [ \'txnType\', \'Purchase\' ], [ \'txnDate\
use the following way to convert the array to an object easily.
var obj = {}; array.forEach(function(e){ obj[e[0]] = e[1] })
This will use the first element as the key and the second element as the value for each element.