Interface NumberStatic

Index

Methods

Methods

public random(n1?: number, n2?: number): number

Returns a random integer between [n1] and [n2].

extra

If only 1 number is passed, the other will be 0. If none are passed, the number will be either 0 or 1.

example

Number.random(50, 100) -> ex. 85 Number.random(50) -> ex. 27 Number.random() -> ex. 0

Parameters

  • n1?: number optional

    Lower bound, default = 0.

  • n2?: number optional

    Uppder bound, default = 1.

Returns

number

Random number between [n1] and [n2].