Skip to content

Commit

Permalink
Translation zh-TW answer 87
Browse files Browse the repository at this point in the history
  • Loading branch information
sexyoung committed Jul 2, 2021
1 parent e8290d9 commit 3e7ac70
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions zh-TW/README_zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -2741,4 +2741,29 @@ function getName(name) {

</p>
</details>
---

###### 87. 將會輸出什麽內容?

```javascript
console.log("I want pizza"[0])
```

- A: `"""`
- B: `"I"`
- C: `SyntaxError`
- D: `undefined`

<details><summary><b>答案</b></summary>
<p>

#### 答案: B

可以使用雙括號表示法獲取字串中特定索引的字串,字串中的第一個字串具有索引0,依此類推。在這種情況下,我們想要得到索引為0的元素,字串`'I'`被記錄。

請注意,IE7及更低版本不支援此方法。應該使用`.charAt()`

</p>
</details>

---

0 comments on commit 3e7ac70

Please sign in to comment.