repeat = function repeat(value) {
  var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  return amount ? value.toString().repeat(amount) : '';
}
Repeats a given value an x amount of times

@author Bastiaan Jansen
@param {string | number} value to repeat
@param {number} amount
@returns repeated string