let url = new URL("https://www.codegrepper.com?s=cool+beans&user_id=4");
let urlParams = new URLSearchParams(url.search);
console.log(urlParams.get('s'));//cool beans
console.log(urlParams.get('user_id'));//4