dailyWord関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { dailyWord } from "@johnmorrisdotca/kotoba";
定義
function dailyWord(words: readonly string[], day?: DayKey | Date | number, options?: DailyOptions): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
words | readonly string[] | The ordered nonempty word pool or accepted-guess dictionary specified by the signature. |
day (省略可) | string | number | Date | A valid YYYY-MM-DD date or moment specified by the signature. |
options (省略可) | DailyOptions | Native game, mount or daily choices specified by the signature. |
戻り値
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.
例
import { dailyWord } from "@johnmorrisdotca/kotoba";
console.log(dailyWord(["apple","berry","lemon"],"2026-10-12",{salt:"sample"}));apple出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。