random() : var

Returns a random number from the range between -1 and +1.

random(var max) : var

Returns a random number from the range between 0 and max.

Example:

if(random() > 0) ... // true in 50% of all cases

See also:

abs

► latest version online