Skip to main content

forEach

method URLSearchParams.forEach
Jump to headingURLSearchParams.forEach(
callbackfn: (
value: string,
key: string,
parent: this,
) => void
,
thisArg?: any,
): void

Calls a function for each element contained in this object in place and return undefined. Optionally accepts an object to use as this when executing callback as second argument.

const params = new URLSearchParams([["a", "b"], ["c", "d"]]);
params.forEach((value, key, parent) => {
  console.log(value, key, parent);
});

Parameters Jump to heading

Jump to headingcallbackfn: (
value: string,
key: string,
parent: this,
) => void
optional
Jump to headingthisArg: any

Return Type Jump to heading

void
Back to top