• Set the type of the object by defining the toStringTag well known symbol, this will impact the Object.prototype.toString.call() results for the object. And can be used to identify the type in the debug output and also in the DevTools watchers window when inspecting the object etc.

    Type Parameters

    • T

    Parameters

    • target: T

      The object to set the toStringTag symbol on

    • nameOrFunc: string | (() => string)

      The name or function to use for the toStringTag

    Returns T

    The target object