Skip to Content
자바스크립트 완벽 가이드
book

자바스크립트 완벽 가이드

by David Flanagan, Han Seon- yong
February 2022
Beginner to intermediate
784 pages
24h 53m
Korean
Insight
Content preview from 자바스크립트 완벽 가이드
JavaScript
110
4장 표현식과 연산자
4.13.6
󻪿󻕿󻱟
void
는 단항 연산자이며 피연산자 타입을 가리지 않습니다. 이 연산자는 좀 이상하
게 동작하며 자주 사용되지는 않습니다.
void
는 피연산자를 평가한 후 그 값을 버
리고
undefined
를 반환합니다. 피연산자의 값이 버려지므로,
void
연산자는 피연산
자에 부수 효과가 있을 때에만 의미가 있습니다.
void
연산자는 매우 모호해서 실질적인 사용 방법을 제시하기 어렵습니다. 굳
이 예를 들자면 아무것도 반환하지 않는 함수를 정의하면서 화살표 함수 단축 문법
(8.1.3절)을 사용하는데, 이 함수의 바디가 단 하나의 표현식이며 이를 평가해야 하
는 경우일 겁니다. 표현식을 평가하는 이유가 오직 그 부수 효과 때문이며 그 값을
반환할 필요는 없다고 하면 사실 함수 바디를 중괄호로 감싸는 것이 가장 단순한
방법입니다. 하지만 다음과 같이
void
연산자를 써도 가능하긴 합니다.
let counter
=
0;
const increment
=
()
=
> void counter++;
increment() //
=
> undefined
counter //
=
> 1
4.13.7
󼐳󺺗󽴔󻪿󻕿󻱟
콤마 연산자는 2항 연산자이며 피연산자의 타입을 가리지 않습니다. 이 연산자는
왼쪽 피연산자를 평가하고, 오른쪽 ...
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

개발자를 위한 필수 수학

개발자를 위한 필수 수학

토머스 닐드
개발 7년차, 매니저 1일차

개발 7년차, 매니저 1일차

권원상, 한민주, 카미유 푸르니에

Publisher Resources

ISBN: 9788966263462