Baseline Widely available
ë¨í ëí기 ì°ì°ì(+
)ë í¼ì°ì°ì ìì ìì¹íë©° í¼ì°ì°ì를 íê°íì§ë§, ë§ì½ í¼ì°ì°ìê° ì«ìê° ìëë¼ë©´ ì«ìë¡ ë³íì ìëí©ëë¤.
const x = 1;
const y = -1;
console.log(+x);
// Expected output: 1
console.log(+y);
// Expected output: -1
console.log(+"");
// Expected output: 0
console.log(+true);
// Expected output: 1
console.log(+false);
// Expected output: 0
console.log(+"hello");
// Expected output: NaN
구문 ì¤ëª
ë¨í ë¶ì (-
)ë ì«ìê° ìë ê°ì ë³íí ì ìì§ë§, ë¨í ëí기ë ì´ë¤ ê²ì ì«ìë¡ ë³ííë ê°ì¥ ë¹ ë¥´ê³ ì í¸íë ë°©ë²ì
ëë¤. ìëíë©´ ì«ìì ëí´ ë¤ë¥¸ ì°ì°ì ìííì§ ì기 ë문ì
ëë¤. ì ìì ì¤ìì 문ìì´ ííë¿ ìëë¼ ë¬¸ìì´ì´ ìë ê°ì¸ true
, false
ë° null
ëí ë³íí ì ììµëë¤. 10ì§ì ë° 16ì§ì(0x
ì ëì¬) íìì ì ì 모ë ì§ìë©ëë¤. ììë ì§ìë©ëë¤(16ì§ì ì ì¸). BigInt ê°ì ì°ì°ì를 ì¬ì©íë©´ TypeErrorê° ë°ìí©ëë¤. í¹ì ê°ì 구문 ë¶ìí ì ìì¼ë©´ NaN
ì¼ë¡ íê°ë©ëë¤.
const x = 1;
const y = -1;
console.log(+x);
// 1
console.log(+y);
// -1
ì«ìê° ìë ê°ì ì¬ì©í기
+true; // 1
+false; // 0
+null; // 0
+function (val) {
return val;
}; // NaN
+1n; // TypeError ë°ì: BigInt ê°ì ì«ìë¡ ë³ê²½í ì ììµëë¤
ëª
ì¸ ë¸ë¼ì°ì í¸íì± ê°ì´ 보기
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4