Helper for generating random values in your code
CoffeeScript JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
src
.gitignore
LICENSE
Makefile
README.md
index.js
package.json

README.md

randomize

Helper for generating random values in your code

Usage

var random = require('randomize');

// Generate random boolean
var randomBoolean = random(); // --> true

// Generate random number between 0 and 100
var randomNumber = random(100); // --> 52

// Return random member of an array
var arr = ['foo', 'bar', 'baz'];
var randomMember = random(arr); // --> 'baz'

// Return random member of arguments object
var randomArg = random('qux', 1, 2); // --> 2

// Return random property of an object
var obj = {foo: 'bar', baz: 'qux', qux: 'foo', bar: 'baz'};
var randomProperty = random(obj); // --> {qux: 'foo'}