--- title: Boolean.prototype slug: conflicting/Web/JavaScript/Reference/Global_Objects/Boolean tags: - Boolean - JavaScript - Property - Prototype translation_of: Web/JavaScript/Reference/Global_Objects/Boolean translation_of_original: Web/JavaScript/Reference/Global_Objects/Boolean/prototype original_slug: Web/JavaScript/Reference/Global_Objects/Boolean/prototype ---
{{JSRef}}

Boolean.prototype 속성은 {{jsxref("Boolean")}} 생성자의 프로토타입을 나타냅니다.

{{js_property_attributes(0, 0, 0)}}
{{EmbedInteractiveExample("pages/js/boolean-constructor.html")}}

설명

{{jsxref("Boolean")}} 인스턴스는 Boolean.prototype을 상속받습니다. 생성자의 프로토타입 객체를 사용해 모든 Boolean 인스턴스에 속성이나 메서드를 추가할 수 있습니다.

속성

Boolean.prototype.constructor
인스턴스의 프로토타입을 생성한 함수를 반환합니다. 기본값은 {{jsxref("Boolean")}} 함수입니다.

메서드

{{jsxref("Boolean.prototype.toSource()")}} {{non-standard_inline}}
{{jsxref("Boolean")}} 객체의 소스를 포함한 문자열을 반환합니다. 반환 문자열을 사용해 동일한 객체를 생성할 수 있습니다. {{jsxref("Object.prototype.toSource()")}} 메서드를 재정의합니다.
{{jsxref("Boolean.prototype.toString()")}}
객체의 값에 따라 문자열 "true" 또는 "false"를 반환합니다. {{jsxref("Object.prototype.toString()")}} 메서드를 재정의합니다.
{{jsxref("Boolean.prototype.valueOf()")}}
{{jsxref("Boolean")}} 객체의 원시 값을 반환합니다. {{jsxref("Object.prototype.valueOf()")}} 메서드를 재정의합니다.

명세

Specification Status Comment
{{SpecName('ES1')}} {{Spec2('ES1')}} Initial definition. Implemented in JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.6.3.1', 'Boolean.prototype')}} {{Spec2('ES5.1')}}  
{{SpecName('ES6', '#sec-boolean.prototype', 'Boolean.prototype')}} {{Spec2('ES6')}}  
{{SpecName('ESDraft', '#sec-boolean.prototype', 'Boolean.prototype')}} {{Spec2('ESDraft')}}  

브라우저 호환성

{{Compat("javascript.builtins.Boolean.prototype")}}