0.0.8 • Published 10 years ago

jsrandom v0.0.8

Weekly downloads
1
License
ISC
Repository
github
Last release
10 years ago

random.js

Build Status

JavaScript random tools

Install

npm install jsrandom

Usage

var random = require('jsrandom');
var arr = [1, 2, 3, 4, 5];

var obj = {
  '1': 1,
  '2': 2,
  '3': 3,
  '4': 4
};

console.log(random.randomInt(1, 10));
console.log(random.randomArray(arr));
console.log(random.randomObject(obj));
console.log(random.choice(arr));

Methods

randomInt(min, max)

Generate a random number between min(inclusive) and max(inclusive).

randomArray(arr)

Generate a random order array.

randomObject(obj)

Generate a random object.

choice(arr)

Return a random element from an array.
0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago