Skip to content

Instantly share code, notes, and snippets.

@nurbek-ab
Created October 4, 2020 14:55
Show Gist options
  • Save nurbek-ab/f159263ccb602f8ecd0de4aafa3c7262 to your computer and use it in GitHub Desktop.
Save nurbek-ab/f159263ccb602f8ecd0de4aafa3c7262 to your computer and use it in GitHub Desktop.
Remove URL search parameter
const removeSearchParam = param => {
const url = new URL(window.location.href)
url.searchParams.delete(param)
window.history.replaceState(null, null, url)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment