formatJavaScript(items) {
    const count = items.length;
    switch (count) {
      case 0:
        return '';
      case 1:
        return String(items[0]);
      case 2:
        return this.patternBasedJoinTwoStrings_(
            this.listTwoPattern_, String(items[0]), String(items[1]));
    }

    // More than two items
    let result = this.patternBasedJoinTwoStrings_(
        this.listStartPattern_, String(items[0]), String(items[1]));

    for (let i = 2; i < count - 1; ++i) {
      result = this.patternBasedJoinTwoStrings_(
          this.listMiddlePattern_, result, String(items[i]));
    }

    return this.patternBasedJoinTwoStrings_(
        this.listEndPattern_, result, String(items[count - 1]));
  }
Formats an array of strings into a string with JavaScript.
It is a user facing, locale-aware list (i.e. 'red, green, and blue').
Taken directly

@param {!Array<string|number>} items Items to format.
@return {string} The items formatted into a string, as a list.
@private