code: function(arr) {
      var repeatReg = /{{\s*repeat\((\d+),?\s*(\d*)?\)\s*}}/,
          resultArray = [];
  
      for(var i = 0; i < arr.length; i++) {
        var item = arr[i];
  
        // if item is string and has repeat method, repeat the next item to result array
        if(typeof  item === 'string' && repeatReg.test(item)) {
          var nextItem = arr[++i],
              min = parseInt(RegExp.$1) || 0,
              max = parseInt(RegExp.$2),
              length;
  
          length = isNaN(max) ? min : _.random(min, max);
  
          if(nextItem) {
            for(var j = 0; j < length; j++) {
              // parse the next item and pass the index value
              resultArray.push(generate(_.clone(nextItem), j));
            }
          }
  
        } else {
          resultArray.push(generate(item));
        }
      }
  
      return resultArray;
    }
docs: parse array