We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe4d147 commit 393c05fCopy full SHA for 393c05f
1-js/05-data-types/08-weakmap-weakset/02-recipients-when-read/task.md
@@ -4,16 +4,18 @@ importance: 5
4
5
# 保存阅读日期
6
7
-这里有一个和[前一任务](info:task/recipients-read)相像的消息数组。情境相似。
+这儿有一个和 [上一个任务](info:task/recipients-read) 类似的 `messages` 数组。场景也相似。
8
9
```js
10
let messages = [
11
- {text: "Hello", from: "John"},
12
- {text: "How goes?", from: "John"},
13
- {text: "See you soon", from: "Alice"}
+ {text: "Hello", from: "John"},
+ {text: "How goes?", from: "John"},
+ {text: "See you soon", from: "Alice"}
14
];
15
```
16
17
现在的问题是:你建议采用什么数据结构来保存信息:“消息是什么时候被阅读的?”。
18
19
-在前一个任务中我们只需要保存“是/否”。现在我们需要保存日期,并且它也应该在消息没有了就消失。
+在前一个任务中我们只需要保存“是/否”。现在我们需要保存日期,并且它应该在消息被垃圾回收时也被从内存中清除。
20
+
21
+P.S. 日期可以存储为内建的 `Date` 类的对象,稍后我们将进行介绍。
0 commit comments