Function uniqueId

  • Generates a unique ID. If prefix is given, the ID is appended to it.

    Parameters

    • prefix: string = "$lodash$"

      The value to prefix the ID with.

    Returns string

    Returns the unique ID.

    Since

    5.12.0

    See

    [[random]]

    Example

    uniqueId('contact_')
    // => 'contact_104'

    uniqueId()
    // => '105'