이라는 사실을 모르고 실수하는 사람들이 많습니다. 불리언 리터럴은 다음과 같이 써야 합니다.
let
heating
=
true
;
let
cooling
=
false
;
3.10
심볼
심볼
symbol
은 유일한 토큰을 나타내기 위해
ES6
에서 도입한 새 데이터 타입입니다. 심볼은 항상
유일합니다. 다른 어떤 심볼과도 일치하지 않습니다. 이런 면에서는 심볼은 객체와 유사합니다.
객체는 모두 유일합니다. 항상 유일하다는 점을 제외하면 심볼은 원시 값의 특징을 모두 가지고
있으므로 확장성 있는 코드를 만들 수 있습니다. 여기에 대해서는
9
장에서 더 설명합니다.
심볼은
Symbol
()
생성자로 만듭니다.
4
원한다면 생성자에 간단한 설명을 추가할 수 있습니다.
const
RED
=
Symbol
(" ...
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.
O’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
I 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
I’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
I'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.