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 ko.javascript.info — 문자열 따옴표

  • 튜토리얼
  • 코어 자바스크립트
  • 자바스크립트 기본
  • 자료형
돌아가기

문자열 따옴표

중요도: 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.