I'm working with a dataset returned by a library, and it's structured like this:
var givenData = [{"fName": "john"}, {"fName": "mike"}, {"country": "USA"}]
My goal is to group the "fName
" values together and add '[]
' to achieve the following result:
{ 'fName[]': ['john','mike'],'country[]': ['USA'] };
Keep in mind that country
and fName
are completely unrelated.