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

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

by 한선용, 이선 브라운
July 2017
Beginner to intermediate
464 pages
10h 38m
Korean
Hanbit Media, Inc.
Content preview from 러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발
201
7
스코프
대부분의 독자, 특히 다른 언어에 익숙한 독자들은 이 예제를 힐끗 보고 필자가
if
문의 블록
스코프 안에 새 변수
x
를 만들려 한다고 생각할 수 있지만, 그런 일은 일어나지 않습니다.
var
를 쓰면 혼란스럽고 쓸모없는 코드가 생길 수 있는데 왜 이런 키워드를 만들었는지 의문이
든다면
let
키워드가 만들어진 이유를 이해한 겁니다. 물론
var
를 써도 명확하고 이해하기 쉬
운 코드를 작성할 수 있지만, 혼란스럽고 불명확한 코드를 작성할 위험은 여전합니다.
var
뜯어고치면 기존 코드가 모두 망가지므로 대신
ES6
에서
let
을 새로 만든 겁니다.
필자는
let
대신
var
를 써서 더 좋은 코드나 더 명확한 코드를 쓰는 방법을 도저히 떠올릴 수
없습니다. 달리 말해
var
에는
let
보다 나은 점이 전혀 없습니다. 필자를 포함해, 자바스크립트
커뮤니티에서는 대부분
let
이 언젠가
var
를 완전히 대체할 것으로 예상합니다. 언젠가는
var
가 최종적으로 폐기될 날이 올 수도 있습니다.
그럼 왜
var
와 호이스팅을 이해해야 할까요? 이유는 두 가지입니다.
ES6
를 어디에서든 쓸 수
있으려면 아직 시간이 더 필요하므로
ES5
로 트랜스컴파일을 해야 합니다. 기존 코드는 전부
ES5
로 작성됐다는 건 말할 필요도 없겠죠. 따라서 아직은
var
가 어떻게 ...
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