we can grab the query string using window.location.search
const queryString = window.location.search;
We can then parse the query string’s parameters using URLSearchParams
const urlParams = new URLSearchParams(queryString);
URLSearchParams.get() will return the first value associated with the given search parameter
const product = urlParams.get('product')