Boolean.prototype.valueOf()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015ë 7ì.
valueOf() ë©ìëë Boolean ê°ì²´ì ìì ê°ì ë°íí©ëë¤.
ìëí´ ë³´ê¸°
const x = new Boolean();
console.log(x.valueOf());
// Expected output: false
const y = new Boolean("Mozilla");
console.log(y.valueOf());
// Expected output: true
구문
js
bool.valueOf();
ë°í ê°
Boolean ê°ì²´ì ìì ê°.
ì¤ëª
valueOf() ë©ìëë Boolean ê°ì²´ë ë¶ë¦¬ì¸ 리í°ë´ì ìì ê°ì Boolean ìë£íì ê°ì¼ë¡ ë°íí©ëë¤.
valueOf() ë©ìëë ë³´íµ JavaScript ë´ë¶ìì í¸ì¶íë©° ì½ëìì ëª
ìì ì¼ë¡ ì¬ì©íì§ë ììµëë¤.
ìì
>valueOf ì¬ì©í기
js
var x = new Boolean();
x.valueOf(); // false
ëª ì¸
| Specification |
|---|
| ECMAScript® 2027 Language Specification> # sec-boolean.prototype.valueof> |