ecmascript:template_literal
差分
このページの2つのバージョン間の差分を表示します。
| 次のリビジョン | 前のリビジョン | ||
| ecmascript:template_literal [2018/10/29 07:07] – 作成 nullpon | ecmascript:template_literal [2018/10/29 07:33] (現在) – [String.rawメソッド] nullpon | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== テンプレート文字列 ====== | + | ====== Template Literal ====== |
| + | |||
| + | * https:// | ||
| + | ===== テンプレートリテラル | ||
| < | < | ||
| 行 7: | 行 10: | ||
| </ | </ | ||
| - | タグ付きテンプレート文字列。 | + | ===== タグ付きテンプレートリテラル ===== |
| < | < | ||
| 行 17: | 行 20: | ||
| const s = uc`Hello ${a}!`; | const s = uc`Hello ${a}!`; | ||
| console.log(s); | console.log(s); | ||
| + | </ | ||
| + | |||
| + | ===== String.rawメソッド ===== | ||
| + | テンプレートリテラルを使わずに、同様の処理を実装できる。 | ||
| + | |||
| + | < | ||
| + | const a = " | ||
| + | const b = " | ||
| + | |||
| + | `the ${a} is not a ${b}.` === String.raw({raw: | ||
| </ | </ | ||
ecmascript/template_literal.1540796869.txt.gz · 最終更新: by nullpon