URLSearchParams
URLSearchParams - Web APIs | MDN
const urlParams = new URL(document.location.toString()).searchParams
urlParams.get("param")
Web APIs