Function uniqueId

  • Generates a unique ID using random numbers. If a prefix is given, the ID is appended to it and returned as a string.

    Returns

    Returns the numeric or string ID.

    Example

    uniqueId()
    // 3445556877

    uniqueId('user_')
    // 'user_1033763188'

    Parameters

    • Optional pre: string = ''

      The id prefix.

    Returns string

Generated using TypeDoc