index.js
function commonPrefixOf (a, b) { // eslint-disable-line id-length
  const minLen = Math.min(a.length, b.length)
  let i = 0
  for (; i < minLen; ++i) {
    if (a[i] !== b[i]) {
      break
    }
  }
  return a.substring(0, i)
}
function commonPrefixOf (a, b) { // eslint-disable-line id-length
  const minLen = Math.min(a.length, b.length)
  let i = 0
  for (; i < minLen; ++i) {
    if (a[i] !== b[i]) {
      break
    }
  }
  return a.substring(0, i)
}
function commonPrefixOf ( a , b ) { // eslint-disable-line id-length const minLen = Math . min ( a . length , b . length ) let i = 0 for ( ; i < minLen ; ++ i ) { if ( a [ i ] !== b [ i ] ) { break } } return a . substring ( 0 , i ) }
The longest prefix of a that is also a prefix of b
The longest prefix of a that is also a prefix of b