aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/javascript/reference/global_objects/string/concat/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ko/web/javascript/reference/global_objects/string/concat/index.html')
-rw-r--r--files/ko/web/javascript/reference/global_objects/string/concat/index.html105
1 files changed, 105 insertions, 0 deletions
diff --git a/files/ko/web/javascript/reference/global_objects/string/concat/index.html b/files/ko/web/javascript/reference/global_objects/string/concat/index.html
new file mode 100644
index 0000000000..1d5b4f2cd6
--- /dev/null
+++ b/files/ko/web/javascript/reference/global_objects/string/concat/index.html
@@ -0,0 +1,105 @@
+---
+title: String.prototype.concat()
+slug: Web/JavaScript/Reference/Global_Objects/String/concat
+tags:
+ - JavaScript
+ - Method
+ - Prototype
+ - Reference
+ - String
+translation_of: Web/JavaScript/Reference/Global_Objects/String/concat
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>concat()</code></strong> 메서드는 매개변수로 전달된 모든 문자열을 호출 문자열에 붙인 새로운 문자열을 반환합니다.</p>
+
+<p>{{EmbedInteractiveExample("pages/js/string-concat.html")}}</p>
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox"><code><var>str</var>.concat(<var>string2</var>, <var>string3</var>[, ..., <var>stringN</var>])</code></pre>
+
+<h3 id="매개변수">매개변수</h3>
+
+<dl>
+ <dt><code>string2...string<em>N</em></code></dt>
+ <dd>합칠 문자열.</dd>
+</dl>
+
+<h3 id="반환값">반환값</h3>
+
+<p>주어진 문자열을 모두 붙인 새로운 문자열.</p>
+
+<h2 id="설명">설명</h2>
+
+<p><code>concat()</code> 함수는 호출 문자열에 문자열 인수를 이어 붙인 결과를 반환합니다. 원본 문자열과 결과 문자열의 변형은 서로에게 영향을 미치지 않습니다. 인수가 문자열이 아니면 계산 전에 문자열로 변환합니다.</p>
+
+<h2 id="예제">예제</h2>
+
+<h3 id="concat_사용하기"><code>concat()</code> 사용하기</h3>
+
+<p>아래 예제에서는 문자열을 결합하여 새로운 문자열을 만듭니다.</p>
+
+<pre><code>var hello = 'Hello, ';
+console.log(hello.concat('Kevin', '. Have a nice day.'));
+/* Hello, Kevin. Have a nice day. */
+
+var greetList = ['Hello', ' ', 'Venkat', '!'];
+"".concat(...greetList); // "Hello Venkat!"
+
+"".concat({}); // [object Object]
+"".concat([]); // ""
+"".concat(null); // "null"
+"".concat(true); // "true"
+"".concat(4, 5); // "45"</code></pre>
+
+<h2 id="성능">성능</h2>
+
+<p><code>concat()</code> 메서드보다 {{jsxref("Operators/Assignment_Operators", "할당 연산자", "", 1)}} (<code>+</code>, <code>+=</code>)를 사용하는게 더 좋습니다. <a href="https://web.archive.org/web/20170404182053/https://jsperf.com/concat-vs-plus-vs-join">성능 테스트</a> 결과에 따르면 할당 연산자의 속도가 몇 배 빠릅니다.</p>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES3')}}</td>
+ <td>{{Spec2('ES3')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.2.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.5.4.6', 'String.prototype.concat')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-string.prototype.concat', 'String.prototype.concat')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-string.prototype.concat', 'String.prototype.concat')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p>{{Compat("javascript.builtins.String.concat")}}</p>
+
+<div></div>
+
+<div id="compat-mobile"></div>
+
+<h2 id="관련문서">관련문서</h2>
+
+<ul>
+ <li>{{jsxref("Array.prototype.concat()")}}</li>
+ <li>{{jsxref("Operators/Assignment_Operators", "Assignment operators", "", 1)}}</li>
+</ul>