random

Source:

Methods

(static) randomArrayItem(array)

Description:
  • Returns a randome item from the array

Source:
Parameters:
Name Type Description
array Array
Returns:

Item from array

(static) randomInt(min, max) → {Number}

Source:
See:
Parameters:
Name Type Description
min Number
max Number
Returns:
Type
Number

(static) randomInterval(callback, min, max) → {function}

Description:
  • Calls callback at random intervals

Source:
Parameters:
Name Type Description
callback *

Function to call on interval

min Number

Minimium interval (ms)

max *

Maximum interval (ms)

Returns:

Function to stop

Type
function

(static) randomString(length, allowed) → {string}

Description:
  • Generates a random string of defined length based on a string of allowed characters.

Source:
Parameters:
Name Type Description
length number

How many random characters will be in the returned string. Defaults to 10

allowed string

Which characters can be used when creating the random string. Defaults to A-Z,a-z,0-9

Returns:

A string of random characters

Type
string

(static) randomTimeStamp()

Description:
  • Returns a random timestamp (hours:minutes:seconds)

Source: