diff options
Diffstat (limited to 'files/ko/web/javascript/reference/global_objects/boolean/tostring')
-rw-r--r-- | files/ko/web/javascript/reference/global_objects/boolean/tostring/index.html | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/files/ko/web/javascript/reference/global_objects/boolean/tostring/index.html b/files/ko/web/javascript/reference/global_objects/boolean/tostring/index.html new file mode 100644 index 0000000000..5cdb2c1f47 --- /dev/null +++ b/files/ko/web/javascript/reference/global_objects/boolean/tostring/index.html @@ -0,0 +1,69 @@ +--- +title: Boolean.prototype.toString() +slug: Web/JavaScript/Reference/Global_Objects/Boolean/toString +tags: + - Boolean + - JavaScript + - Method + - Prototype + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/Boolean/toString +--- +<div>{{JSRef}}</div> + +<p><code><strong>toString()</strong></code> 메서드는 {{jsxref("Boolean")}} 객체를 나타내는 문자열을 반환합니다.</p> + +<div>{{EmbedInteractiveExample("pages/js/boolean-tostring.html")}}</div> + + + +<h2 id="구문">구문</h2> + +<pre class="syntaxbox notranslate"><var>bool</var>.toString()</pre> + +<h3 id="반환_값">반환 값</h3> + +<p>{{jsxref("Boolean")}} 객체를 나타내는 문자열.</p> + +<h2 id="설명">설명</h2> + +<p>{{jsxref("Boolean")}} 객체는 {{jsxref("Object.prototype.toString()")}} 메서드를 상속받지 않고 재정의합니다. <code>Boolean</code> 객체에서 <code>toString()</code> 메서드는 객체의 문자열 표현을 반환합니다.</p> + +<p>JavaScript는 {{jsxref("Boolean")}}을 문자열로 표현해야 할 때나 문자열 결합에 사용할 때 <code>toString()</code>을 자동으로 호출합니다.</p> + +<p><code>toString()</code>은 불리언 객체의 값에 따라 문자열 "<code>true</code>" 또는 "<code>false</code>"를 반환합니다.</p> + +<h2 id="예제">예제</h2> + +<h3 id="toString_사용하기"><code>toString()</code> 사용하기</h3> + +<pre class="brush: js notranslate">var flag = new Boolean(true); +flag.toString(); // false +</pre> + +<h2 id="명세">명세</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-boolean.prototype.tostring', 'Boolean.prototype.toString')}}</td> + </tr> + </tbody> +</table> + +<h2 id="브라우저_호환성">브라우저 호환성</h2> + +<div> + + +<p>{{Compat("javascript.builtins.Boolean.toString")}}</p> +</div> + +<h2 id="같이_보기">같이 보기</h2> + +<ul> + <li>{{jsxref("Object.prototype.toString()")}}</li> +</ul> |