Sitemap

Parsing the URL query parameter

1 min readApr 17, 2019

--

In the last decade, browsers have seen a lot of improvement. When we want to parse the URL we still have to use some library or write our own function!

That's a bit sad! ☹️

I really don't want to add another library to parse the query parameters! One of the cleanest solutions I have seen is https://gomakethings.com/getting-all-query-string-values-from-a-url-with-vanilla-js/

Here is the suggested solution

I am fine with this.

Get jay the dev’s stories in your inbox

Join Medium for free to get updates from this writer.

But we could make use of new browser functionalities added in the recent years like URLSearchParams.

My approach

As you see

  • its less code 😇
  • Provides more functionalities right from the browser 😍

--

--

jay the dev
jay the dev

Written by jay the dev

0 followers

A JavaScript Enthusiast 😇