Created
October 22, 2022 19:32
-
-
Save oguzhancvdr/21a7b45fd70fe17979ceabb6ce2ba8cc to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Returns the provided URLs search parameters | |
* as a set of key-value pairs. | |
*/ | |
const getURLParameters = (url) => { | |
const { searchParams } = new URL(url); | |
return Object.fromEntries(searchParams); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Get Parameters from a URL and Convert Them to Object