Which is the easiest way to convert this:
[{src:\"websrv1\"}, {dst:\"websrv2\"}, {dstport:\"80\"}]
to this:
{src:\"websrv1\
Here's a simple solution:
var output = {}; for (var i = 0; i < input.length; i++) { for (var n in input[i]) { output[n] = input[i][n]; } }
Demonstration