function toQueryString(data) {
  var query = '', i,
  push = function (key, value) {
    query += encodeURIComponent(key) + '=' + encodeURIComponent(value) + '&';
  }, key, value;

  for (key in data) {
    if (!Object.hasOwnProperty.call(data, key)) {continue;}
    value = data[key];
    if ((typeof data === 'object') && (data instanceof Array)) {
      for (i = 0; i < value.length; i++) { push(key, value[i]);}
    } else {
      push(key, data[key]);
    }
  }
  return query.replace(/&$/, '').replace(/%20/g, '+');
}
/**
 * Convert object|array to query string
 *
 * @param {Object|Array} val The value to test
 * @returns {String} True if value is a Number, otherwise false
 */
Convert object|array to query string

@param {Object|Array} val The value to test
@returns {String} True if value is a Number, otherwise false
Convert object|array to query string @param { Object|Array } val The value to test @returns { String } True if value is a Number otherwise false
function toQueryString(data) {
  var query = '', i,
  push = function (key, value) {
    query += encodeURIComponent(key) + '=' + encodeURIComponent(value) + '&';
  }, key, value;
  for (key in data) {
    if (!Object.hasOwnProperty.call(data, key)) {continue;}
    value = data[key];
    if ((typeof data === 'object') && (data instanceof Array)) {
      for (i = 0; i < value.length; i++) { push(key, value[i]);}
    } else {
      push(key, data[key]);
    }
  }
  return query.replace(/&$/, '').replace(/%20/g, '+');
}
function toQueryString ( data ) { var query = '' , i , push = function ( key , value ) { query += encodeURIComponent ( key ) + '=' + encodeURIComponent ( value ) + '&' ; } , key , value ; for ( key in data ) { if ( ! Object . hasOwnProperty . call ( data , key ) ) { continue ; } value = data [ key ] ; if ( ( typeof data === 'object' ) && ( data instanceof Array ) ) { for ( i = 0 ; i < value . length ; i ++ ) { push ( key , value [ i ] ) ; } } else { push ( key , data [ key ] ) ; } } return query . replace ( / &$ / , '' ) . replace ( / %20 / g , '+' ) ; }
Convert object|array to query string
Convert object|array to query string