Function randomUUID

  • Generates a random UUID (v4) using the crypto API.
    If the environment does not support the crypto.randomUUID method, a random UUID string is generated using the crypto.getRandomValues method.

    Since

    v0.0.1

    Returns

    The generated UUID.

    Example

    // find an object in the list
    console.log(
    randomUUID()
    )
    => '59c1d248-a20f-4e11-bcbb-426fe682a78f'

    Returns string