function serialize (params) {
    var str = [], key, value;
    for (var p in params) {
        if (params.hasOwnProperty(p) && params[p]) {
            key = encodeURIComponent(p);
            value = encodeURIComponent(params[p]);
            str.push(key + '=' + value);
        }
    }
    return str.join('&');
}

/**
 * Serialize's an object into query params for a URL
 * Passes & between params (? or & not prefixed)
 * @param  {object} queryParams The different params to searlize (key becomes &param value becomes =value)
 * @return {string}        Passes back a serialized version from the object ready to be used for a URL
 *
 * @example
 *  var queryParams = {
 *  		'first_name': 'Bart',
 *  		'last_name': 'Simpson'
 * 		};
 * 	searlize(queryParams);
 * 	// returns
 * 	// first_name=Bart&last_name=Simpson
 */
function serialize (queryParams) {
    var str = [],
        key,
        value,
        query;

    for (query in queryParams) {
        if (queryParams.hasOwnProperty(query) && queryParams[query]) {
            key = encodeURIComponent(query);
            value = encodeURIComponent(queryParams[query]);
            str.push(key + '=' + value);
        }
    }

    return str.join('&');
}

Add JSDoc info for serialize