const url = new URL(document.location); url.searchParams.set("lang", "en"); console.log(url.href);
https://codetogo.io/how-to-set-url-search-params-in-javascript/?lang=en