Assuming I have the following:
var array = [ {\"name\":\"Joe\", \"age\":17}, {\"name\":\"Bob\", \"age\":17}, {\"name\":\"Carl\
If this were PHP I'd build an array with the keys and take array_keys at the end, but JS has no such luxury. Instead, try this:
array_keys
var flags = [], output = [], l = array.length, i; for( i=0; i