examples/example.js
function pickCategories() {
  var picked = [];
  var max = Math.floor(Math.random() * maxCategories);
  while(picked.length < max) {
    var category = pickCategory();
    if (picked.indexOf(category) === -1) {
      picked.push(category);
    }
  }
  return picked;
}
function pickCategories() {
  var picked = [];
  var max = Math.floor(Math.random() * maxCategories);
  while(picked.length < max) {
    var category = pickCategory();
    if (picked.indexOf(category) === -1) {
      picked.push(category);
    }
  }
  return picked;
}
function pickCategories ( ) { var picked = [ ] ; var max = Math . floor ( Math . random ( ) * maxCategories ) ; while ( picked . length < max ) { var category = pickCategory ( ) ; if ( picked . indexOf ( category ) === - 1 ) { picked . push ( category ) ; } } return picked ; }
pick random categories up to the `maxCategories`
pick random categories up to the maxCategories