GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing ja.javascript.info — 文字列の引用符

  • チュートリアル
  • JavaScript 言語
  • JavaScript の基礎
  • データ型
レッスンに戻る

文字列の引用符

重要性: 5

このスクリプトの出力はどうなるでしょう?

let name = "Ilya";

alert( `hello ${1}` ); // ?

alert( `hello ${"name"}` ); // ?

alert( `hello ${name}` ); // ?

バッククォートは ${...} の中の式を文字列に埋め込みます。

let name = "Ilya";

// 式は数字の1です
alert( `hello ${1}` ); // hello 1

// 式は文字列の "name" です
alert( `hello ${"name"}` ); // hello name

// 式は変数で、そこに埋め込まれます
alert( `hello ${name}` ); // hello Ilya
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.