if you don't want to use router and want a one line solution you can write this:
router
new URL(window.location.toString()).searchParams.get("test")