<HTML>
<body>
</body>
<script>
let messages = [
{text: "Hello", from: "John"},
{text: "How goes?", from: "John"},
{text: "See you soon", from: "Alice"}
];
let readMap = new WeakMap();
alert(readMap.size);
readMap.set(messages[0], new Date(2019, 3, 5));
</script>
</HTML>
<!--
task4 needed weakSet to save simply readmessage,
this task needs to save THE TIME IT WAS READ
along with the message itself
the message out of the set or map means it hasn't been read
I kinda feel good and bad at the same time
to happen to read the solution
but I do get to think more about the difference with tasks
and be more available to understand the main contents
so I think, its good?
-->
<body>
</body>
<script>
let messages = [
{text: "Hello", from: "John"},
{text: "How goes?", from: "John"},
{text: "See you soon", from: "Alice"}
];
let readMap = new WeakMap();
alert(readMap.size);
readMap.set(messages[0], new Date(2019, 3, 5));
</script>
</HTML>
<!--
task4 needed weakSet to save simply readmessage,
this task needs to save THE TIME IT WAS READ
along with the message itself
the message out of the set or map means it hasn't been read
I kinda feel good and bad at the same time
to happen to read the solution
but I do get to think more about the difference with tasks
and be more available to understand the main contents
so I think, its good?
-->
댓글
댓글 쓰기