JSFiddle - React, Tailwind, and code Playground
JavaScript
let link = 'http://demo.com?a=1&b=2&c=3';
let url = new URL(link);
url.searchParams.forEach(function(value, key, parent){
parent.delete(key);
});
console.log(url.toString());
let link2 = "a=1&b=2&c=3";
let url2 = new URLSearchParams(link2);
for (let entry in url2.entries()) {
console.log(entry[0] + ' : ' + entry[1]);
}