Last active
February 28, 2021 03:52
-
-
Save nahanil/8704a97e1e3b89ba8af17fe3675ccbe0 to your computer and use it in GitHub Desktop.
Get a Chinese radical "by number"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Get a Chinese radical "by number" | |
https://en.wikipedia.org/wiki/Kangxi_radical#Kangxi_Radicals_block | |
@param {uint8} idx positive integer | |
*/ | |
function getRadicalByNumber(idx = 1) { | |
// oob check | |
if (idx < 1 || idx > 214) { | |
return "" | |
} | |
return String.fromCharCode(12031 + idx) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment