function createVersionMap(versionTuples) {
  // Construct a map for easy lookup.
  const versionMap = {};
  versionTuples.forEach((tuple) => {
    // Note that the tuple is of length three, but we only care about the
    // first two.
    const key = tuple[0];
    const value = tuple[1];
    versionMap[key] = value;
  });

  // Gives the value with the first key it finds, otherwise empty string.
  return (keys) => versionMap[keys.find((key) => key in versionMap)] || '';
}
A helper function that returns a function mapping a list of candidate
version tuple keys to the first version string present under a key.
Ex:
<code>
// Arg extracted from "Foo/1.2.3 Bar/0.2021"
const mapVersion = createVersionMap([["Foo", "1.2.3"], ["Bar", "0.2021"]]);
mapVersion(["Bar", "Foo"]); // returns "0.2021"
mapVersion(["Baz", "Foo"]); // returns "1.2.3"
mapVersion(["Baz", "???"]); // returns ""
</code>
@param {!Array<!Array<string>>} versionTuples Version tuples pre-extracted
    from a user agent string.
@return {function(!Array<string>): string} The version string, or empty
string if it doesn't exist under the given key.