We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61469d8 commit 6c830f1Copy full SHA for 6c830f1
1 file changed
1-js/05-data-types/05-array-methods/12-reduce-object/task.md
@@ -4,7 +4,7 @@ importance: 4
4
5
# 从数组创建键(值)对象
6
7
-假设我们有以下形式的用户数组 `{id:..., name:..., age... }`。
+假设我们收到了一个用户数组,形式为:`{id:..., name:..., age... }`。
8
9
创建一个函数 `groupById(arr)` 从该数组创建对象,以 `id` 为键(key),数组项为值。
10
@@ -20,7 +20,7 @@ let users = [
20
let usersById = groupById(users);
21
22
/*
23
-// 调用方法后我们得到:
+// 调用函数后我们得到:
24
25
usersById = {
26
john: {id: 'john', name: "John Smith", age: 20}
@@ -31,8 +31,8 @@ usersById = {
31
```
32
33
34
-处理服务端数据时,此功能很有用。
+处理服务端数据时,这个函数很有用。
35
36
-在这个任务里我们假设 `id` 是唯一的。没有哪两个数组项具有相同的 `id` 。
+在这个任务里我们假设 `id` 是唯一的。没有两个具有相同 `id` 的数组项。
37
38
-请使用数组 `.reduce` 方法解决。
+请在解决方案中使用数组的 `.reduce` 方法。
0 commit comments