Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript serialize 2 dimensional array Reply To: serialize 2 dimensional array

#247931
Shikkediel
Participant

Or this way…

With forEach()

var result = '';

a.forEach(function(it) {
  result += it.join('&');
});

If I understood that to be intended with “serialization” correctly.

The JSON.stringify() approach was interesting as well but I stumbled upon the brackets, quotes and commas being quite circumventive to get removed from the string value.

codepen.io/anon/pen/ENgOOV