Eliminar la propiedad de la cadena de consulta JavaScript

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