lib/generator.js
function random(arr) {

  if(!arr) { return false; }

  if(!arr.length) {
    arr = Object.keys(arr);
  }
  return arr[Math.floor(Math.random() * arr.length)];
}
function random(arr) {

  if(!arr) { return false; }

  if(!arr.length) {
    arr = Object.keys(arr);
  }
  return arr[Math.floor(Math.random() * arr.length)];
}
function random ( arr ) { if ( ! arr ) { return false ; } if ( ! arr . length ) { arr = Object . keys ( arr ) ; } return arr [ Math . floor ( Math . random ( ) * arr . length ) ] ; }
return a random element from an array
or random key from an object
return a random element from an array or random key from an object