function createTagIndex(exampleData) {
  /** @type {Object<string,Array<number>>} */
  const index = {};
  exampleData.forEach((data, i) => {
    data.tags.forEach((tag) => {
      tag = tag.toLowerCase();
      let tagIndex = index[tag];
      if (!tagIndex) {
        tagIndex = [];
        index[tag] = tagIndex;
      }
      tagIndex.push(i);
    });
  });
  return index;
}
Create an index of tags belonging to examples
@param {Array<{tags: Array<string>}>} exampleData Array of example data objects.
@return {Object<string,Array<number>>} Word index.