phe.js
function evaluateCardCodes(codes) {
  const len = codes.length
  if (len === 5) return evaluate5cards.apply(null, codes)
  if (len === 6) return evaluate6cards.apply(null, codes)
  if (len === 7) return evaluate7cards.apply(null, codes)
  throw new Error(`Can only evaluate 5, 6 or 7 cards, you gave me ${len}`)
}
function evaluateCardCodes(codes) {
  const len = codes.length
  if (len === 5) return evaluate5cards.apply(null, codes)
  if (len === 6) return evaluate6cards.apply(null, codes)
  if (len === 7) return evaluate7cards.apply(null, codes)
  throw new Error(`Can only evaluate 5, 6 or 7 cards, you gave me ${len}`)
}
function evaluateCardCodes ( codes ) { const len = codes . length if ( len === 5 ) return evaluate5cards . apply ( null , codes ) if ( len === 6 ) return evaluate6cards . apply ( null , codes ) if ( len === 7 ) return evaluate7cards . apply ( null , codes ) throw new Error ( ` ${ len } ` ) }
Evaluates the 5 - 7 card codes to arrive at a number representing the hand
strength, smaller is better.

@name evaluateCardCodes
@function
@param {Array.<Number>} cards the cards, i.e. `[ 49, 36, 4, 48, 41 ]`
@return {Number} the strength of the hand comprised by the card codes
Evaluates the 5 - 7 card codes to arrive at a number representing the hand strength smaller is better .