Created
September 2, 2022 09:28
-
-
Save sakshstore/53157a7176680749f5daacd117da5a2b to your computer and use it in GitHub Desktop.
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
const getQueryParams = (url) => new URLSearchParams(url.split("?")[1]); | |
// Usage | |
getQueryParams("https://example.com?a=1&b=2"); // { a: "1", b: "2" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment