valueOf()
메서드는 Boolean
객체의 원시 값을 반환합니다.
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.
구문
bool.valueOf()
반환 값
Boolean
객체의 원시 값.
설명
valueOf()
메서드는 Boolean
객체나 불리언 리터럴의 원시 값을 Boolean 자료형의 값으로 반환합니다.
valueOf()
메서드는 보통 JavaScript 내부에서 호출하며 코드에서 명시적으로 사용하지는 않습니다.
예제
valueOf
사용하기
var x = new Boolean();
x.valueOf(); // false
명세
Specification |
---|
ECMAScript (ECMA-262) The definition of 'Boolean.prototype.valueOf' in that specification. |
브라우저 호환성
BCD tables only load in the browser