Top Rounds
| We are Hiring! |

_savedRandom ·

_savedRandom stores a random number against an id and returns the same number for subsequent invocations in that session.

Syntax:

_savedRandom( id, min, max )
First invocation: Returns a random number between min and max
Subsequent calls with the same id: Returns the number that it had returned the first time for the given id.

The parameters are:

  • id: Any string
  • min: Lower limit for the number generated
  • max: Upper limit for the number generated

The min and max parameters are only required during the first invocation.
Defaults for min and max, if omitted, are 0 and 10000 for the first call for an id.

Example:

_savedRandom("login", 100, 200); //returns a random number between 100, 200; say 145. // _savedRandom("login", 100, 200); //will return 145, //since it was saved against the id "login". //The min and max are redundant here. // _savedRandom("login"); //will also return 145.




---


Top Rounds