Reference · Kanji stroke counts
sortByStrokesfunction
The kanji with the fewest strokes first; kanji with the same count keep the order they were given in, and a character with no count goes last. A new array: what was given is not changed.
Import it
import { sortByStrokes } from "@johnmorrisdotca/bushu/strokes";
Definition
function sortByStrokes(kanji: readonly string[]): string[]
Parameters
| Name | Type | Description |
|---|---|---|
kanji | readonly string[] | The kanji to look up, or the supplied kanji list where the signature requires an array. |
Returns
string[]
The kanji with the fewest strokes first; kanji with the same count keep the order they were given in, and a character with no count goes last. A new array: what was given is not changed.
Examples
import { sortByStrokes } from "@johnmorrisdotca/bushu/strokes";
console.log(sortByStrokes(["海","一","水"]));[ '一', '水', '海' ]What it prints (run when this page was built)