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

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

by 한선용, 이선 브라운
July 2017
Beginner to intermediate
464 pages
10h 38m
Korean
Hanbit Media, Inc.
Content preview from 러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발
145
5
표현식과 연산자
5.3
연산자 우선순위
모든 표현식은 값이 된다는 걸 이해했으면, 그다음은 연산자 우선순위를 이해해야 합니다. 연
산자 우선순위를 이해해야 자바스크립트 프로그램이 어떻게 동작하는지 이해할 수 있습니다.
산술 연산자를 설명했으니 자바스크립트의 여러 연산자에 대한 설명을 잠시 멈추고 연산자 우
선순위에 대해 생각해 봅시다. 초등 교육을 받았다면 연산자 우선순위에 대해 배웠을 겁니다.
다음 문제는 어렵지 않게 풀 수 있을 겁니다(수학 문제만 보면 짜증이 나는 독자에게는 미리
사과하겠습니다 ).
8
÷
2
+
3
× (
4
×
2
-
1
)
25
라고 답했다면 연산자 우선순위를 정확히 적용한 겁니다. 괄호가 제일 먼저고, 그다음에 곱
셈과 나눗셈을 하고, 마지막으로 덧셈과 뺄셈을 합니다.
자바스크립트는 표현식을 평가할 때도 비슷한 규칙을 적용합니다. 산수에만 쓰는 것은 아닙니
다. 자바스크립트에서 표현식을 평가하는 순서도 초등학교에서 배웠던 것과 같습니다.
물론 자바스크립트에는 연산자가 훨씬 더 많으니 기억할 것이 늘어나기는 합니다. 다행히, 산
수와 마찬가지로 괄호가 최우선입니다. 표현식 순서가 잘 기억나지 않으면, 가장 먼저 이루어
져야 하는 순서대로 괄호를 쓰면 그대로 이루어질 겁니다.
현재 자바스크립트에는
56
개의 연산자가 있고, 우선순위를 기준으로 ...
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