isRedfunction
Whether a card is a heart or a diamond.
Import it
import { isRed } from "@johnmorrisdotca/toranpu/deck";
Definition
function isRed(card: Card): boolean
Parameters
| Name | Type | Description |
|---|---|---|
card | Card | The physical card or card id to read, draw or play. |
Returns
boolean
Whether a card is a heart or a diamond.
Examples
import { isRed } from "@johnmorrisdotca/toranpu/deck";
const card = { suit: "spades", rank: 1 } as const;
console.log(isRed(card));falseWhat it prints (run when this page was built)