URLSearchParams

The URLSearchParams interface defines utility methods to work with the query string of a URL.

MDN Reference

Constructors

Link copied to clipboard
constructor(init: ReadonlyRecord<JsString, JsString>)
constructor(init: String)
constructor(init: URLSearchParams)
constructor(init: ReadonlyArray<Tuple2<JsString, JsString>> = definedExternally)

Properties

Link copied to clipboard
open override val size: Int

The size read-only property of the URLSearchParams interface indicates the total number of search parameter entries.

Functions

Link copied to clipboard
fun append(key: String, value: String)

The append() method of the URLSearchParams interface appends a specified key/value pair as a new search parameter.

Link copied to clipboard
fun delete(key: String, value: String = definedExternally)

The delete() method of the URLSearchParams interface deletes specified parameters and their associated value(s) from the list of all search parameters.

Link copied to clipboard
open override fun entries(): JsIterator<Tuple2<JsString, JsString>>
Link copied to clipboard
open override fun forEach(action: (value: JsString, key: JsString) -> Unit)
Link copied to clipboard
open operator fun get(key: Symbol.iterator): () -> JsIterator<Tuple2<JsString, JsString>>

open override fun get(key: JsString): JsString?

The get() method of the URLSearchParams interface returns the first value associated to the given search parameter.

Link copied to clipboard

The getAll() method of the URLSearchParams interface returns all the values associated with a given search parameter as an array.

Link copied to clipboard
open override fun has(key: JsString): Boolean

The has() method of the URLSearchParams interface returns a boolean value that indicates whether the specified parameter is in the search parameters.

fun has(key: String, value: String): Boolean
Link copied to clipboard
open inline operator fun iterator(): Iterator<Tuple2<JsString, JsString>>
Link copied to clipboard
open override fun keys(): JsIterator<JsString>
Link copied to clipboard
fun set(key: String, value: String)

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

Link copied to clipboard
fun sort()

The URLSearchParams.sort() method sorts all key/value pairs contained in this object in place and returns undefined.

Link copied to clipboard
open override fun values(): JsIterator<JsString>