You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: zh-TW/README_zh-TW.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2133,3 +2133,27 @@ export const sum = (a, b) => a + b;
2133
2133
</details>
2134
2134
2135
2135
---
2136
+
###### 68. 將會輸出什麽內容?
2137
+
2138
+
```javascript
2139
+
console.log(Number(2) ===Number(2));
2140
+
console.log(Boolean(false) ===Boolean(false));
2141
+
console.log(Symbol('foo') ===Symbol('foo'));
2142
+
```
2143
+
2144
+
- A: `true`, `true`, `false`
2145
+
- B: `false`, `true`, `false`
2146
+
- C: `true`, `false`, `true`
2147
+
- D: `true`, `true`, `true`
2148
+
2149
+
<details><summary><b>答案</b></summary>
2150
+
<p>
2151
+
2152
+
#### 答案: A
2153
+
2154
+
每個 Symbol 都是完全唯一的。傳遞給 Symbol 的參數只是給 Symbol 的一個描述。 Symbol 的值不依賴於傳遞的參數。當我們建立兩個全新的 Symbol 去比較時:第一個`Symbol('foo')`,第二個`Symbol('foo')`, 因這兩個值是唯一的,彼此不相等,因此 `Symbol('foo') === Symbol('foo')` 會得到 `false`。
0 commit comments