Skip to content

Instantly share code, notes, and snippets.

@nilsandrey
Created October 26, 2021 06:02
Show Gist options
  • Save nilsandrey/17ca60d305ffdea8026443701c5a7aba to your computer and use it in GitHub Desktop.
Save nilsandrey/17ca60d305ffdea8026443701c5a7aba to your computer and use it in GitHub Desktop.
Return the value of an expected query string parameter. Return `null` if not present.
export function qsParam(name) {
return new URLSearchParams(document.location.search).get(name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment