code: function repeat (string, width) {
    var result = ''
    var n = width
    do {
      if (n % 2) {
        result += string
      }
      n = Math.floor(n / 2)
      /* eslint no-self-assign: 0 */
      string += string
    } while (n && stringWidth(result) < width)
  
    return wideTruncate(result, width)
  }
docs: lodash's way of repeating