Which is the easiest way to convert this:
[{src:\"websrv1\"}, {dst:\"websrv2\"}, {dstport:\"80\"}]
to this:
{src:\"websrv1\
Use .reduce().
.reduce()
var result = data.reduce(function(obj, item) { for (var key in item) obj[key] = item[key]; return obj; }, {});