randi(a?: number, b?: number): number
rand() but floored to integer. If not arguments, returns 0 or 1.
param
a- The lower bound. If not upper bound, this is the upper bound.
param
b- The upper bound.
randi(); // returns either 0 or 1 randi(10); // returns a random integer between 0 and 9 randi(10, 20); // returns a random integer between 10 and 19
returns
A random integer between 0 and 1.
since
v2000.0