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


I’m not so sure either but it turns out to be quite an interesting question, going into the possibilities of JS methods. This one’s pretty neat too:


var result = {
  return it.join('&');

result = result.join('&');

So with the first step and .map a single new array is created while looping over each element (it), looking like this:


Then that array is also turned into a string with join, using & as the separator character: