Boolean.prototype
속성은 Boolean
생성자의 프로토타입을 나타냅니다.
Property attributes of Boolean.prototype |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
설명
Boolean
인스턴스는 Boolean.prototype
을 상속받습니다. 생성자의 프로토타입 객체를 사용해 모든 Boolean
인스턴스에 속성이나 메서드를 추가할 수 있습니다.
속성
Boolean.prototype.constructor
- 인스턴스의 프로토타입을 생성한 함수를 반환합니다. 기본값은
Boolean
함수입니다.
메서드
Boolean.prototype.toSource()
Boolean
객체의 소스를 포함한 문자열을 반환합니다. 반환 문자열을 사용해 동일한 객체를 생성할 수 있습니다.Object.prototype.toSource()
메서드를 재정의합니다.Boolean.prototype.toString()
- 객체의 값에 따라 문자열
"true"
또는"false"
를 반환합니다.Object.prototype.toString()
메서드를 재정의합니다. Boolean.prototype.valueOf()
Boolean
객체의 원시 값을 반환합니다.Object.prototype.valueOf()
메서드를 재정의합니다.
명세
Specification | Status | Comment |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Standard | Initial definition. Implemented in JavaScript 1.0. |
ECMAScript 5.1 (ECMA-262) The definition of 'Boolean.prototype' in that specification. |
Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Boolean.prototype' in that specification. |
Standard | |
ECMAScript Latest Draft (ECMA-262) The definition of 'Boolean.prototype' in that specification. |
Draft |
브라우저 호환성
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | Server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
prototype | Chrome Full support 1 | Edge Full support 12 | Firefox Full support 1 | IE Full support 3 | Opera Full support Yes | Safari Full support Yes | WebView Android Full support 1 | Chrome Android Full support 18 | Firefox Android Full support 4 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support 1.0 | nodejs Full support Yes |
Legend
- Full support
- Full support