Reference · Rules, tiles and records
sameLettersfunction
Whether two tallies hold the same letters, as many of each.
Import it
import { sameLetters } from "@johnmorrisdotca/kumimoji";
Definition
function sameLetters(a: Map<string, number>, b: Map<string, number>): boolean
Parameters
| Name | Type | Description |
|---|---|---|
a | Map<string, number> | The first letter-count map. |
b | Map<string, number> | The second letter-count map. |
Returns
boolean
Whether two tallies hold the same letters, as many of each.
Examples
import { lettersOf, sameLetters } from "@johnmorrisdotca/kumimoji";
console.log(sameLetters(lettersOf("cat"),lettersOf("act")));trueWhat it prints (run when this page was built)