aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/javascript/reference/operators/addition/index.html
blob: 0cc793a775c1d005f65cdd0fdeb8773d3397a6c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
title: 더하기 (+)
slug: Web/JavaScript/Reference/Operators/Addition
tags:
  - JavaScript
  - Language feature
  - Operator
  - Reference
browser-compat: javascript.operators.addition
translation_of: Web/JavaScript/Reference/Operators/Addition
---

<div>{{jsSidebar("Operators")}}</div>

<p>더하기 연산자(<code>+</code>)는 숫자 피연산자의 합을 구하거나, 문자열을 서로 연결합니다.</p>

<div>{{EmbedInteractiveExample("pages/js/expressions-addition.html")}}</div>

<h2 id="syntax">구문</h2>

<pre class="brush: js">x + y</pre>

<h2 id="examples">예제</h2>

<h3 id="numeric_addition">덧셈</h3>

<pre class="brush: js">
// Number + Number -&gt; 덧셈
1 + 2 // 3
  
// Boolean + Number -&gt; 덧셈
true + 1 // 2

// Boolean + Boolean -&gt; 덧셈
false + false // 0</pre>

<h3 id="string_concatenation">문자열 연결</h3>

<pre class="brush: js">
// String + String -&gt; 연결
'foo' + 'bar' // "foobar"

// Number + String -&gt; 연결
5 + 'foo' // "5foo"

// String + Boolean -&gt; 연결
'foo' + false // "foofalse"</pre>

<h2 id="specifications">명세</h2>

{{Specifications}}

<h2 id="browser_compatibility">브라우저 호환성</h2>

<p>{{Compat}}</p>

<h2 id="see_also">같이 보기</h2>

<ul>
  <li><a href="/ko/docs/Web/JavaScript/Reference/Operators/Subtraction">빼기 연산자</a></li>
  <li><a href="/ko/docs/Web/JavaScript/Reference/Operators/Division">나누기 연산자</a></li>
  <li><a
      href="/ko/docs/Web/JavaScript/Reference/Operators/Multiplication">곱하기 연산자</a></li>
  <li><a href="/ko/docs/Web/JavaScript/Reference/Operators/Remainder">나머지 연산자</a></li>
  <li><a
      href="/ko/docs/Web/JavaScript/Reference/Operators/Exponentiation">거듭제곱 연산자</a></li>
  <li><a href="/ko/docs/Web/JavaScript/Reference/Operators/Increment">증가 연산자</a></li>
  <li><a href="/ko/docs/Web/JavaScript/Reference/Operators/Decrement">감소 연산자</a></li>
  <li><a href="/ko/docs/Web/JavaScript/Reference/Operators/Unary_negation">단항 부정 연산자</a></li>
  <li><a href="/ko/docs/Web/JavaScript/Reference/Operators/Unary_plus">단항 플러스 연산자</a></li>
</ul>