set

fun set(key: String, value: String)(source)

The set() method of the URLSearchParams interface sets the value associated with a given search parameter to the given value.

MDN Reference