Function getUrlParam

  • Returns the value of the specified query parameter in the input URL.


    const p1 = getUrlParam('', 't3');
    const p2 = getUrlParam('', 't4');
    console.log(p1, p2);


    3 4


    • url: string

      The URL string.

    • param: string

      The query parameter to retrieve the value for.

    Returns string | string[]

    The value of the specified query parameter, or an empty string if the parameter is not found.