code: function getIndexOfItemWithTextPrefix(element, prefix) {
    const itemTextContents = getItemTextContents(element);
    const prefixLength = prefix.length;
    for (let i = 0; i < itemTextContents.length; i++) {
      const itemTextContent = itemTextContents[i];
      if (itemTextContent.substr(0, prefixLength) === prefix) {
        return i;
      }
    }
    return -1;
  }
docs: Return the index of the first item with the given prefix, else -1.