0.0.8 • Published 9 years ago

jsrandom v0.0.8

Weekly downloads
1
License
ISC
Repository
github
Last release
9 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

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago