In Javascript, It has inbuilt URLSearchParams function to get the query string values.
Example:
const query= new URLSearchParams(window.location.search);
const clientCode = query.get(“clientCode”);
Ref : https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams