const params = new URLSearchParams(location.search) params.delete('key_to_delete') console.log(params.toString())