Which is the easiest way to convert this:
[{src:\"websrv1\"}, {dst:\"websrv2\"}, {dstport:\"80\"}]
to this:
{src:\"websrv1\
My 2cents, very easy to read:
var myObj = {}; myArray.forEach(function(obj) { var prop = Object.keys(obj)[0]; myObj[prop] = obj[prop]; })