Skip to main content
Version: 3.14.1

URLSearchParams.forEach()

The forEach() method of the URLSearchParams interface allows iteration through all values contained in this object via a callback function.

Syntax

forEach(callback)
forEach(callback, thisArg)

Parameters

  • callback

    • : Function to execute on each element, which is passed the following arguments:

      • value
        • : The value of the current entry being processed in the URLSearchParams object.
      • key
        • : The key of the current entry being processed in the URLSearchParams object.
      • searchParams
        • : The URLSearchParams object the forEach() was called upon.
  • thisArg optional

    • : Value to use as this when executing callback.

Return value

None undefined.