function latestDottedVersion(versions) {
  const len = versions.length
  if (len === 0) {
    return
  }
  let version = versions[0]
  for (let i = 1; i < len; i++) {
    if (compareDottedVersion(version, versions[i]) < 0) {
      version = versions[i]
    }
  }
  return version
}
Finds the largest version number lexicographically from an array of strings representing version numbers and returns it as a string.

@param {string[]} versions - The array of version numbers to compare
@returns {string|undefined} The largest version number as a string, or undefined if the array is empty
@example
latestDottedVersion(['1.2.3', '1.2.4', '1.3', '2.0']) // returns '2.0' because it is the largest version number in the array.
latestDottedVersion([]) // returns undefined because the array is empty.