Skip to Content
러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발
book

러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발

by 한선용, 이선 브라운
July 2017
Beginner to intermediate
464 pages
10h 38m
Korean
Hanbit Media, Inc.
Content preview from 러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발
87
3
리터럴과 변수, 상수, 데이터 타입
let
currentTemp
=
19
.
5
;
//
00b0
는 온도를 나타내는 유니코드 코드 포인트입니다.
const
message
= "
The
current
temperature
is
" +
currentTemp
+ "\
u00b0C
";
ES6
이전에는 변수나 상수를 문자열 안에 쓰는 방법은 (외부 라이브러리를 사용하지 않으면 )
자열 병합뿐이었습니다.
ES6
에서는
문자열 템플릿
template
이라는 기능을 도입했습니다. 이 기능을
문자열 채우기
interpolation
라 부르기도 합니다. 문자열 템플릿은 문자열의 정해진 위치에 값을 채워
넣는 간편한 방법입니다. 문자열 템플릿에는 큰따옴표나 작은따옴표를 쓰지 않고 백틱
backtick
사용합니다. 다음은 앞에서 살펴본 예제를 문자열 템플릿을 사용해서 고쳐 쓴 겁니다.
let
currentTemp
=
19
.
5
;
const
message
= `
The
current
temperature
is
${
currentTemp
}\
u00b0C
`;
문자열 템플릿 안에서는 달러 기호가 특수문자가 됩니다. 달러 기호 다음에 중괄호로 감싼 값
3
을 쓰면 그 값이 문자열에 삽입됩니다 (문자열 템플릿 안에 달러 기호를 써야 한다면 역슬래시
로 이스케이프하면 됩니다 ).
문자열 템플릿은 필자가
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

웹 애플리케이션 보안: 정찰, 공격, 방어 세 단계로 배우는 웹 애플리케이션 보안의 모든 것

웹 애플리케이션 보안: 정찰, 공격, 방어 세 단계로 배우는 웹 애플리케이션 보안의 모든 것

최용, 앤드루 호프먼

Publisher Resources

ISBN: 9788968483387