const url = new URL('https://example.com/?firstkey=firstvalue&secondkey=secondvalue'); let searchParams = Array.from(url.searchParams.entries()); console.log(searchParams);