Created
December 12, 2023 05:59
-
-
Save nillpo/5b3ab01f37bffe24bdfa249c655407f2 to your computer and use it in GitHub Desktop.
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
function* meraGenerator() { | |
for (let i = 0x30A1; i <= 0x30FA; i++) { | |
yield `${String.fromCharCode(i)}メラ`; | |
} | |
} | |
console.log( | |
[...meraGenerator()].sort().reduce((p, c, index) => { | |
if (index % 10 === 0) { | |
p.push([c]); | |
} else { | |
p[p.length - 1].push(c); | |
} | |
return p; | |
}, [] as string[][]).map((s) => s.join(",")).join("\n"), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment