query.entries() code example
Example 1: javascript reading query parameter
// example url: https://mydomain.com/?fname=johnny&lname=depp
const urlParams = new URLSearchParams(window.location.search);
const firstName = urlParams.get('fname'); // johnny
Example 2: generate query string from urlsearchparams
URLSearchParams.toString()