sameCardfunction
Whether two card objects are the same card.
Import it
import { sameCard } from "@johnmorrisdotca/toranpu/deck";
Definition
function sameCard(a: Card, b: Card): boolean
Parameters
| Name | Type | Description |
|---|---|---|
a | Card | The first card or value to compare. |
b | Card | The second card or value to compare. |
Returns
boolean
Whether two card objects are the same card.
Examples
import { cardFromId, sameCard } from "@johnmorrisdotca/toranpu/deck";
const card = { suit: "spades", rank: 1 } as const;
console.log(sameCard(card, cardFromId("AS")!));trueWhat it prints (run when this page was built)