aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/javascript/reference/global_objects/boolean
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:17 -0500
commitda78a9e329e272dedb2400b79a3bdeebff387d47 (patch)
treee6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/ko/web/javascript/reference/global_objects/boolean
parent1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff)
downloadtranslated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz
translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2
translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip
initial commit
Diffstat (limited to 'files/ko/web/javascript/reference/global_objects/boolean')
-rw-r--r--files/ko/web/javascript/reference/global_objects/boolean/boolean/index.html55
-rw-r--r--files/ko/web/javascript/reference/global_objects/boolean/index.html108
-rw-r--r--files/ko/web/javascript/reference/global_objects/boolean/prototype/index.html81
-rw-r--r--files/ko/web/javascript/reference/global_objects/boolean/tostring/index.html69
-rw-r--r--files/ko/web/javascript/reference/global_objects/boolean/valueof/index.html67
5 files changed, 380 insertions, 0 deletions
diff --git a/files/ko/web/javascript/reference/global_objects/boolean/boolean/index.html b/files/ko/web/javascript/reference/global_objects/boolean/boolean/index.html
new file mode 100644
index 0000000000..bbe86a5134
--- /dev/null
+++ b/files/ko/web/javascript/reference/global_objects/boolean/boolean/index.html
@@ -0,0 +1,55 @@
+---
+title: Boolean() 생성자
+slug: Web/JavaScript/Reference/Global_Objects/Boolean/Boolean
+tags:
+ - Boolean
+ - Constructor
+ - JavaScript
+ - Reference
+translation_of: Web/JavaScript/Reference/Global_Objects/Boolean/Boolean
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>Boolean()</code></strong> 생성자는 {{jsxref("Boolean")}} 객체를 생성할 때 사용합니다.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/boolean-constructor.html")}}</div>
+
+
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox">new Boolean([<var>value</var>])</pre>
+
+<h3 id="매개변수">매개변수</h3>
+
+<dl>
+ <dt><code>value</code> {{optional_inline}}</dt>
+ <dd><code>Boolean</code> 객체의 초깃값.</dd>
+</dl>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-boolean-constructor', 'Boolean constructor')}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<div>
+
+
+<p>{{Compat("javascript.builtins.Boolean.Boolean")}}</p>
+</div>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li>용어 사전: {{Glossary("Boolean")}}</li>
+</ul>
diff --git a/files/ko/web/javascript/reference/global_objects/boolean/index.html b/files/ko/web/javascript/reference/global_objects/boolean/index.html
new file mode 100644
index 0000000000..06618f3ffe
--- /dev/null
+++ b/files/ko/web/javascript/reference/global_objects/boolean/index.html
@@ -0,0 +1,108 @@
+---
+title: Boolean
+slug: Web/JavaScript/Reference/Global_Objects/Boolean
+tags:
+ - Boolean
+ - Constructor
+ - JavaScript
+ - Reference
+translation_of: Web/JavaScript/Reference/Global_Objects/Boolean
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>Boolean</code></strong> 객체는 불리언 값을 감싸고 있는 객체입니다.</p>
+
+<h2 id="설명">설명</h2>
+
+<p>첫 번재 매개변수로서 전달한 값은 필요한 경우 불리언 값으로 변환됩니다. 값이 없거나 <code>0</code>, <code>-0</code>, {{jsxref("null")}}, <code>false</code>, {{jsxref("NaN")}}, {{jsxref("undefined")}}, 빈 문자열 (<code>""</code>)이라면 객체의 초기값은 <code>false</code>가 됩니다. 문자열 <code>"false"</code>를 포함한 그 외 모든 다른 값은 초기값을 <code>true</code>로 설정합니다.</p>
+
+<p><code>Boolean</code> 객체의 <code>true</code>와 <code>false</code> 값을 원시 <code>Boolean</code> 값 <code>true</code>, <code>false</code>와 혼동해선 안됩니다.</p>
+
+<p>값이 {{jsxref("undefined")}}, {{jsxref("null")}}이 아닌 <strong>모든</strong> 객체는 조건문에서 <code>true</code>로 계산됩니다. 이는 값이 <code>false</code>인 <code>Boolean</code> 객체도 포함합니다. 즉 아래 {{jsxref("Statements/if...else", "if")}} 문의 조건은 참입니다.</p>
+
+<pre class="brush: js notranslate">var x = new Boolean(false);
+if (x) {
+ // 이 코드는 실행됨
+}
+</pre>
+
+<p>그러나 원시 <code>Boolean</code> 값에는 적용되지 않습니다. 따라서 아래 {{jsxref("Statements/if...else", "if")}} 문의 조건은 거짓입니다.</p>
+
+<pre class="brush: js notranslate">var x = false;
+if (x) {
+ // 이 코드는 실행되지 않음
+}
+</pre>
+
+<p>불리언이 아닌 값을 변환할 때 <code>Boolean</code> 객체를 사용해선 안됩니다. 대신 <code>Boolean</code> 함수를 사용하세요.</p>
+
+<pre class="brush: js notranslate">var x = Boolean(expression); // 추천
+var x = new Boolean(expression); // 사용하지 말것</pre>
+
+<p>값이 <code>false</code>인 <code>Boolean</code> 객체를 포함한 어떠한 객체를 <code>Boolean</code> 객체의 초기값으로 넘겨주더라도 새로운 <code>Boolean</code> 객체는 <code>true</code>를 가집니다.</p>
+
+<pre class="brush: js notranslate">var myFalse = new Boolean(false); // 초기값 거짓
+var g = Boolean(myFalse); // 초기값 참
+var myString = new String('Hello'); // 문자열 객체
+var s = Boolean(myString); // 초기값 참</pre>
+
+<p><code>Boolean</code> 원시 값의 자리에서 <code>Boolean</code> 객체를 이용해선 안됩니다.</p>
+
+<h2 id="생성자">생성자</h2>
+
+<dl>
+ <dt>{{jsxref("Boolean.Boolean", "Boolean()")}}</dt>
+ <dd><code>Boolean</code> 객체를 생성합니다.</dd>
+</dl>
+
+<h2 id="인스턴스_메서드">인스턴스 메서드</h2>
+
+<dl>
+ <dt>{{jsxref("Boolean.prototype.toString()")}}</dt>
+ <dd>객체의 값에 따라 문자열 <code>"true"</code> 또는 <code>"false"</code>를 반환합니다. {{jsxref("Object.prototype.toString()")}} 메서드를 재정의합니다.</dd>
+ <dt>{{jsxref("Boolean.prototype.valueOf()")}}</dt>
+ <dd>{{jsxref("Boolean")}} 객체의 원시값을 반환합니다. {{jsxref("Object.prototype.valueOf()")}} 메서드를 재정의합니다.</dd>
+</dl>
+
+<h2 id="예제">예제</h2>
+
+<h3 id="false_값으로_초기화한_Boolean_객체_만들기"><code>false</code> 값으로 초기화한 <code>Boolean</code> 객체 만들기</h3>
+
+<pre class="brush: js notranslate">var bNoParam = new Boolean();
+var bZero = new Boolean(0);
+var bNull = new Boolean(null);
+var bEmptyString = new Boolean('');
+var bfalse = new Boolean(false);</pre>
+
+<h3 id="true_값으로_초기화한_Boolean_객체_만들기"><code>true</code> 값으로 초기화한 <code>Boolean</code> 객체 만들기</h3>
+
+<pre class="brush: js notranslate">var btrue = new Boolean(true);
+var btrueString = new Boolean('true');
+var bfalseString = new Boolean('false');
+var bSuLin = new Boolean('Su Lin');
+var bArrayProto = new Boolean([]);
+var bObjProto = new Boolean({});</pre>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-boolean-objects', 'Boolean')}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p>{{Compat("javascript.builtins.Boolean")}}</p>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li>{{Glossary("Boolean")}}</li>
+ <li>{{interwiki("wikipedia", "불리언 자료형")}}</li>
+</ul>
diff --git a/files/ko/web/javascript/reference/global_objects/boolean/prototype/index.html b/files/ko/web/javascript/reference/global_objects/boolean/prototype/index.html
new file mode 100644
index 0000000000..7d1ce4f379
--- /dev/null
+++ b/files/ko/web/javascript/reference/global_objects/boolean/prototype/index.html
@@ -0,0 +1,81 @@
+---
+title: Boolean.prototype
+slug: Web/JavaScript/Reference/Global_Objects/Boolean/prototype
+tags:
+ - Boolean
+ - JavaScript
+ - Property
+ - Prototype
+translation_of: Web/JavaScript/Reference/Global_Objects/Boolean
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>Boolean.prototype</code></strong> 속성은 {{jsxref("Boolean")}} 생성자의 프로토타입을 나타냅니다.</p>
+
+<div>{{js_property_attributes(0, 0, 0)}}</div>
+
+<div>{{EmbedInteractiveExample("pages/js/boolean-constructor.html")}}</div>
+
+
+
+<h2 id="설명">설명</h2>
+
+<p>{{jsxref("Boolean")}} 인스턴스는 <code>Boolean.prototype</code>을 상속받습니다. 생성자의 프로토타입 객체를 사용해 모든 <code>Boolean</code> 인스턴스에 속성이나 메서드를 추가할 수 있습니다.</p>
+
+<h2 id="속성">속성</h2>
+
+<dl>
+ <dt><code>Boolean.prototype.constructor</code></dt>
+ <dd>인스턴스의 프로토타입을 생성한 함수를 반환합니다. 기본값은 {{jsxref("Boolean")}} 함수입니다.</dd>
+</dl>
+
+<h2 id="메서드">메서드</h2>
+
+<dl>
+ <dt>{{jsxref("Boolean.prototype.toSource()")}} {{non-standard_inline}}</dt>
+ <dd>{{jsxref("Boolean")}} 객체의 소스를 포함한 문자열을 반환합니다. 반환 문자열을 사용해 동일한 객체를 생성할 수 있습니다. {{jsxref("Object.prototype.toSource()")}} 메서드를 재정의합니다.</dd>
+ <dt>{{jsxref("Boolean.prototype.toString()")}}</dt>
+ <dd>객체의 값에 따라 문자열 <code>"true"</code> 또는 <code>"false"</code>를 반환합니다. {{jsxref("Object.prototype.toString()")}} 메서드를 재정의합니다.</dd>
+ <dt>{{jsxref("Boolean.prototype.valueOf()")}}</dt>
+ <dd>{{jsxref("Boolean")}} 객체의 원시 값을 반환합니다. {{jsxref("Object.prototype.valueOf()")}} 메서드를 재정의합니다.</dd>
+</dl>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.0.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.6.3.1', 'Boolean.prototype')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-boolean.prototype', 'Boolean.prototype')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-boolean.prototype', 'Boolean.prototype')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+
+
+<p>{{Compat("javascript.builtins.Boolean.prototype")}}</p>
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>
diff --git a/files/ko/web/javascript/reference/global_objects/boolean/valueof/index.html b/files/ko/web/javascript/reference/global_objects/boolean/valueof/index.html
new file mode 100644
index 0000000000..50df1d98d2
--- /dev/null
+++ b/files/ko/web/javascript/reference/global_objects/boolean/valueof/index.html
@@ -0,0 +1,67 @@
+---
+title: Boolean.prototype.valueOf()
+slug: Web/JavaScript/Reference/Global_Objects/Boolean/valueOf
+tags:
+ - Boolean
+ - JavaScript
+ - Method
+ - Prototype
+ - Reference
+translation_of: Web/JavaScript/Reference/Global_Objects/Boolean/valueOf
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>valueOf()</strong></code> 메서드는 {{jsxref("Boolean")}} 객체의 원시 값을 반환합니다.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/boolean-valueof.html")}}</div>
+
+
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox notranslate"><var>bool</var>.valueOf()</pre>
+
+<h3 id="반환_값">반환 값</h3>
+
+<p>{{jsxref("Boolean")}} 객체의 원시 값.</p>
+
+<h2 id="설명">설명</h2>
+
+<p><code>valueOf()</code> 메서드는 {{jsxref("Boolean")}} 객체나 불리언 리터럴의 원시 값을 Boolean 자료형의 값으로 반환합니다.</p>
+
+<p><code>valueOf()</code> 메서드는 보통 JavaScript 내부에서 호출하며 코드에서 명시적으로 사용하지는 않습니다.</p>
+
+<h2 id="예제">예제</h2>
+
+<h3 id="valueOf_사용하기"><code>valueOf</code> 사용하기</h3>
+
+<pre class="brush: js notranslate">var x = new Boolean();
+x.valueOf(); // false
+</pre>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-boolean.prototype.valueof', 'Boolean.prototype.valueOf')}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<div>
+
+
+<p>{{Compat("javascript.builtins.Boolean.valueOf")}}</p>
+</div>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li>{{jsxref("Object.prototype.valueOf()")}}</li>
+</ul>