Skip to content

URLSearchParams

[<Interface>]
type URLSearchParams =
    abstract member forEach<'TThis> (fn: Fn, ?thisArg: 'TThis) : unit
AssemblyXantham.Fable.Node
ImplementsURLSearchParams

URLSearchParams class is a global reference for import { URLSearchParams } from 'node:url' https://nodejs.org/api/url.html#class-urlsearchparams

@since v10.0.0

Declared inside

ForEach

Methods

abstract member forEach<'TThis> (fn: Fn, ?thisArg: 'TThis) : unit

Iterates over each name-value pair in the query and invokes the given function.

const myURL = new URL('https://example.org/?a=b&#x26;c=d');
myURL.searchParams.forEach((value, name, searchParams) => {
console.log(name, value, myURL.searchParams === searchParams);
});
// Prints:
//   a b true
//   c d true
Parameter
fnInvoked for each name-value pair in the query
thisArgTo be used as this value for when fn is called