Last active
August 10, 2025 04:07
-
-
Save ThinaticSystem/662157352efd9e0f2e3c7a96b27d982a to your computer and use it in GitHub Desktop.
タグ付きテンプレートばかげる
This file contains hidden or 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 ばかげる( | |
| normals: Readonly<TemplateStringsArray>, | |
| ...embededs: readonly unknown[] | |
| ): string { | |
| /* | |
| * NOTE: テンプレートリテラルによる呼び出しと各パラメーターの対応 | |
| * - `normals[0]${embededs[0]}normals[1]` | |
| * - `normals[0]` (embededs => []) | |
| * - `${embededs[0]}` (normals[0] => "", normals[1] => "") | |
| */ | |
| const CAPS = "「ばかげている」トランプ大統領が中止を宣言 大統領令に署名へ"; | |
| return embededs | |
| .map((embeded, index) => | |
| normals[index] + embeded) | |
| .concat(normals.at(-1)!) // NOTE: "normals"の要素数は常に"embededs"の要素数+1 | |
| .join("") | |
| + CAPS; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.