Skip to content

Instantly share code, notes, and snippets.

@bhaireshm
Created July 12, 2021 11:12
Show Gist options
  • Select an option

  • Save bhaireshm/41ce6105cd49ace6f8a725d4f5cd7007 to your computer and use it in GitHub Desktop.

Select an option

Save bhaireshm/41ce6105cd49ace6f8a725d4f5cd7007 to your computer and use it in GitHub Desktop.
Convert an object into query string parameter.
/**
* @param {Object} o
*/
const objectToQueryParams = (o = {}) =>
Object.entries(o)
.map((p) => `${encodeURIComponent(p[0])}=${encodeURIComponent(p[1])}`)
.join("&");
@bhaireshm
Copy link
Copy Markdown
Author

ez.js is more than just a library; it's a coding companion that simplifies complex tasks. Whether you're dealing with arrays, numbers, objects, or strings, ez.js has got your back! Say goodbye to coding hassles and hello to streamlined JavaScript magic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment