1 var randInt = require('./randInt');
2 var isArray = require('../lang/isArray');
5 * Returns a random element from the supplied arguments
6 * or from the array (if single argument is an array).
8 function choice(items) {
9 var target = (arguments.length === 1 && isArray(items))? items : arguments;
10 return target[ randInt(0, target.length - 1) ];
13 module.exports = choice;