uniqueId source npm

_.uniqueId([prefix])

Generates a unique ID. If prefix is provided the ID is appended to it.

Arguments

  1. [prefix] (string)

    The value to prefix the ID with.

Returns (string)

Returns the unique ID.

Example

_.uniqueId('contact_');
// => 'contact_104'

_.uniqueId();
// => '105'