Chartbreaker
    Preparing search index...

    Interface URLSearchParams

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

    MDN Reference

    interface URLSearchParams {
        size: number;
        "[iterator]"(): URLSearchParamsIterator<[string, string]>;
        append(name: string, value: string): void;
        delete(name: string, value?: string): void;
        entries(): URLSearchParamsIterator<[string, string]>;
        forEach(
            callbackfn: (
                value: string,
                key: string,
                parent: URLSearchParams,
            ) => void,
            thisArg?: any,
        ): void;
        get(name: string): string | null;
        getAll(name: string): string[];
        has(name: string, value?: string): boolean;
        keys(): URLSearchParamsIterator<string>;
        set(name: string, value: string): void;
        sort(): void;
        toString(): string;
        values(): URLSearchParamsIterator<string>;
    }
    Index

    Properties

    size: number

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

    MDN Reference

    Methods

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

      MDN Reference

      Parameters

      • name: string
      • value: string

      Returns void

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

      MDN Reference

      Parameters

      • name: string
      • Optionalvalue: string

      Returns void

    • Parameters

      • callbackfn: (value: string, key: string, parent: URLSearchParams) => void
      • OptionalthisArg: any

      Returns void

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

      MDN Reference

      Parameters

      • name: string

      Returns string | null

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

      MDN Reference

      Parameters

      • name: string

      Returns string[]

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

      MDN Reference

      Parameters

      • name: string
      • Optionalvalue: string

      Returns boolean

    • The set() method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. If there were several matching values, this method deletes the others. If the search parameter doesn't exist, this method creates it.

      MDN Reference

      Parameters

      • name: string
      • value: string

      Returns void

    • The URLSearchParams.sort() method sorts all key/value pairs contained in this object in place and returns undefined. Key/value pairs are sorted by the values of the UTF-16 code units of the keys. This method uses a stable sorting algorithm (i.e., the relative order between key/value pairs with equal keys will be preserved).

      MDN Reference

      Returns void

    • Returns string