Function logAndReturn

  • Accepts a parameter, logs it and then returns it

    Returns

    the value passed in t

    Example

    logAndReturn(2) === 2 // also logs "2"
    

    Example

    logAndReturn(2, 'my value') === 2 // also logs "my value 2"
    

    Type Parameters

    • T

    Parameters

    • t: T

      the value to log

    • msg: string = ""

      an optional message to log with

    Returns T

Generated using TypeDoc