Baseline Widely available
åæ³ï¼-
ï¼è¿ç®ç¬¦å°ä¸¤ä¸ªæä½æ°ç¸åï¼å¹¶äº§ç两è
ä¹å·®ã
console.log(5 - 3);
// Expected output: 2
console.log(3.5 - 5);
// Expected output: -1.5
console.log(5 - "hello");
// Expected output: NaN
console.log(5 - true);
// Expected output: 4
è¯æ³ æè¿°
åæ³è¿ç®ç¬¦å°ä¸¤ä¸ªæä½æ°è½¬æ¢ä¸ºæ°å¼ï¼å¹¶æ ¹æ®ä¸¤ä¸ªæä½æ°çç±»åæ§è¡æ°ååæ³æ BigInt åæ³ãå¦æç±»åä¸å¹é
ï¼åæåº TypeError
ã
// Number - Number -> subtraction
5 - 3; // 2
// Number - Number -> subtraction
3 - 5; // -2
éæ°å¼åæ³
// String - Number -> subtraction
"foo" - 3; // NaN; "foo" is converted to the number NaN
// Number - String -> subtraction
5 - "3"; // 2; "3" is converted to the number 3
BigInt åæ³
// BigInt - BigInt -> subtraction
2n - 1n; // 1n
ä½ ä¸è½å¨åæ³ä¸æ··åä½¿ç¨ BigInt åæ°åæä½æ°ã
2n - 1; // TypeError: Cannot mix BigInt and other types, use explicit conversions
2 - 1n; // TypeError: Cannot mix BigInt and other types, use explicit conversions
è§è æµè§å¨å
¼å®¹æ§ åè§
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