Function funSetName

  • This function sets the name of a function and returns the function with the new name.

    Type Parameters

    • T

      The type of the function.

    Parameters

    • name: string

      The new name to be set for the function.

    • fun: T

      The function whose name is to be set.

    Returns T

    The function with the new name.

    Example

    const myFun = () => 'Hello World';
    funSetName('newFun', myFun).name;;
    //=> 'newFun'

Generated using TypeDoc