evaluateHand
evaluateHand(
cards):PokerHand
Defined in: cards/poker.ts:218
Finds the best five-card poker hand in 5 to 7 cards (for Hold'em, two hole cards plus
the board). Aces play high, or low in the wheel A 2 3 4 5, the lowest straight.
Suits never break ties.
const hand = evaluateHand(['AS', 'KS', 'QS', 'JS', 'TS', '2D', '3C']);hand.category; // 'straight-flush'hand.description; // 'Royal flush'Throws a RangeError for fewer than 5 or more than 7 cards or a duplicate card, and a TypeError for a string that is not a card.
Parameters
Section titled “Parameters”readonly ("2S" | "2H" | "2D" | "2C" | "3S" | "3H" | "3D" | "3C" | "4S" | "4H" | "4D" | "4C" | "5S" | "5H" | "5D" | "5C" | "6S" | "6H" | "6D" | "6C" | "7S" | "7H" | "7D" | "7C" | "8S" | "8H" | "8D" | "8C" | "9S" | "9H" | "9D" | "9C" | "AS" | "AH" | "AD" | "AC" | "TS" | "TH" | "TD" | "TC" | "JS" | "JH" | "JD" | "JC" | "QS" | "QH" | "QD" | "QC" | "KS" | "KH" | "KD" | "KC")[]
