0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

JavaScript勉強ログ 文字列テンプレートリテラル

Last updated at Posted at 2025-04-21

String型の理解

テンプレートリテラル
文字列を書く方法

文字列をバッククォートで囲む。
`${}`の中に変数を入れると、その値を文字列中に埋め込むことが出来る、
`${変数}`

let menu = "蕎麦";
let str = `注文は${menu}です。`;
console.log(str);
//注文は蕎麦です。

メモ:テンプレートリテラル内は、そのまま改行を入れられる。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?