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?

More than 5 years have passed since last update.

JavaScript(定数、テンプレートリテラル)

Posted at

定数

変数と似たものに定数がある。
定数は更新(上書き)が出来ない。

定数の定義

「let」の代わりに**「const」**を用いて定義する。

テンプレートリテラル

「+」とは違う、連結方式。
定数(変数)を文字列のなかに埋め込むことができる。

${(定数・変数)}
文字列全体をバッククォート(`)で囲む。

//テンプレートリテラルの書き方
const name = "太郎" ;
console.log(`こんにちは、${name}さん`);

//コンソール
こんにちは太郎さん
0
0
0

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?