Created
February 22, 2023 19:09
-
-
Save TheRainTrain/21c52734c92dd28f45dc3b9f27302895 to your computer and use it in GitHub Desktop.
Parse the ? query thing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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