How to GET array from string in Javascript?

Hi is there such a line:
var str = 'param1=1¶m2=2&';
I want this to get the array object and the array function to a variable example:
to get what I need
June 3rd 19 at 19:27
1 answer
June 3rd 19 at 19:29
If you work in the browser, there is an interface URLSearchParams. In particular, it has methods that return an iterable object.

Find more questions by tags JavaScriptWeb DevelopmentArrays