mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2024-04-21 12:32:22 +00:00
+2
-2
@@ -845,8 +845,8 @@ arr.flatMap(function callback(currentValue[, index[, array]]) {
|
||||
|
||||
```javascript
|
||||
const arr = [5, 12, 8, 130, 44];
|
||||
arr.at[2] // 8
|
||||
arr.at[-2] // 130
|
||||
arr.at(2) // 8
|
||||
arr.at(-2) // 130
|
||||
```
|
||||
|
||||
如果参数位置超出了数组范围,`at()`返回`undefined`。
|
||||
|
||||
Reference in New Issue
Block a user