var url = new URL("http://localhost:3000/product?product=4"); var params = new URLSearchParams(url.search); alert(params.get("product"));