DEV Community

Discussion on: How to get Query String Parameters in Javascript - 2019

Collapse
 
daviddalbusco profile image
David Dal Busco

Didn't tried out but it seems that URLSearchParams offers iterator to get all query strings.

From the doc:

URLSearchParams.entries()
Returns an iterator allowing iteration through all key/value pairs contained in this object.

URLSearchParams.keys()
Returns an iterator allowing iteration through all keys of the key/value pairs contained in this object.

Found out an example too: davidwalsh.name/query-string-javas...

That being said, the good point of your method is that it is compatible with Internet Explorer 😉

Thread Thread
 
ganeshmani profile image
GaneshMani

Cool.. Thanks for the update. i will add this in article.