Reference · Marking, scores and game rules
dailyWordfunction
The word of a day: the same for everybody who asks about the same day of the
same list. Give a YYYY-MM-DD day, or a Date (read as a day in UTC, or in
zone). Throws a RangeError for an empty list or a day that is not one.
Import it
import { dailyWord } from "@johnmorrisdotca/kotoba";
Definition
function dailyWord(words: readonly string[], day?: DayKey | Date | number, options?: DailyOptions): string
Parameters
| Name | Type | Description |
|---|---|---|
words | readonly string[] | The ordered nonempty word pool or accepted-guess dictionary specified by the signature. |
day (optional) | string | number | Date | A valid YYYY-MM-DD date or moment specified by the signature. |
options (optional) | DailyOptions | Native game, mount or daily choices specified by the signature. |
Returns
string
The word of a day: the same for everybody who asks about the same day of the same list. Give a YYYY-MM-DD day, or a Date (read as a day in UTC, or in zone). Throws a RangeError for an empty list or a day that is not one.
Examples
import { dailyWord } from "@johnmorrisdotca/kotoba";
console.log(dailyWord(["apple","berry","lemon"],"2026-10-12",{salt:"sample"}));appleWhat it prints (run when this page was built)