Description
jQuery.param returns &undefined= as part of the string when looping over a empty array element
Given the following code:
var condition = false;
var myArray = [
{ name: 'name1', value: 'value1' },
condition && { name: 'name2', value: 'value2' },
{ name: 'name3', value: 'value3' },
];
var serialized = $.param(myArray);
// output= 'name1=value1&undefined=&name3=value3'
Link to test case
http://jsfiddle.net/vedghafn/
Is this desired behavior? The documentation page on jQuery.param() does not mention this. A simple solution would be to check if this.name actually exists before calling add() in serialize.js