Skip to content

Instantly share code, notes, and snippets.

@npretto
Last active November 6, 2019 09:16
Show Gist options
  • Select an option

  • Save npretto/bee43c05bcf72b002d21bc2f4f446087 to your computer and use it in GitHub Desktop.

Select an option

Save npretto/bee43c05bcf72b002d21bc2f4f446087 to your computer and use it in GitHub Desktop.
query string to object
queryString.split("&").map(string => string.split("=")).reduce((params,[key,value]) => ({...params, [key]:value}),{})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment