Reference · The functions that read the tables
levelOffunction
Which JLPT level's list holds a kanji.
Import it
import { levelOf } from "@johnmorrisdotca/jisho";
Definition
function levelOf(table: JlptTable, kanji: string): JlptLevel | null
Parameters
| Name | Type | Description |
|---|---|---|
table | JlptTable |
|
kanji | string | One kanji. |
Returns
JlptLevel | null
The level, or null when no list holds the kanji (that says nothing about how hard it is), or when the text is not exactly one character.
Examples
import { levelOf } from "@johnmorrisdotca/jisho";
import { JLPT } from "@johnmorrisdotca/jisho/jlpt";
console.log(levelOf(JLPT, "日"), levelOf(JLPT, "鬱")); // N5 nullN5 nullWhat it prints (run when this page was built)