Skip to content

Instantly share code, notes, and snippets.

@olizilla olizilla/queryify.js
Created Dec 21, 2016

What would you like to do?
Minimal object to query string function
function queryify (obj) {
const pairs = Object.keys(obj).map((k) => {
const key = encodeURIComponent(k)
const val = encodeURIComponent(obj[k])
return key + '=' + val
return '?' + pairs.join('&')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.