Getting Query String Values in JavaScript in 2021
Safely access URLSearchParams
Published in
2 min readFeb 8, 2021
In the past, there wasn’t a simple solution to the simple problem of retrieving key-value pairs from the query string of a URL in plain JavaScript.
Let’s take a look at the following URL: http://example.com/search?someParam=someValue&anotherParam=anotherValue
. The information that we are interested in…