method URLSearchParams.prototype.forEach
Jump to headingURLSearchParams.prototype.forEach<TThis = this>(fn: () => void,thisArg?: TThis,): void
Iterates over each name-value pair in the query and invokes the given function.
const myURL = new URL('https://example.org/?a=b&c=d');
myURL.searchParams.forEach((value, name, searchParams) => {
console.log(name, value, myURL.searchParams === searchParams);
});
// Prints:
// a b true
// c d true
Type Parameters Jump to heading
Jump to headingTThis = this
Parameters Jump to heading
Jump to headingfn: () => void
Invoked for each name-value pair in the query
optional
Jump to headingthisArg: TThis
To be used as this
value for when fn
is called
Return Type Jump to heading
void