Skip to content

Instantly share code, notes, and snippets.

@TheRainTrain
Created February 22, 2023 19:09
Show Gist options
  • Select an option

  • Save TheRainTrain/21c52734c92dd28f45dc3b9f27302895 to your computer and use it in GitHub Desktop.

Select an option

Save TheRainTrain/21c52734c92dd28f45dc3b9f27302895 to your computer and use it in GitHub Desktop.
Parse the ? query thing
function parseSearch(search) {
let argsRaw = search.substring(1).split("&").map(arg => arg.split("="));
const args = {};
for(const arg of argsRaw)
args[arg[0]] = arg[1];
return args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment