728x90
let messages = [
{text: "Hello", from: "John"},
{text: "How goes?", from: "John"},
{text: "See you soon", from: "Alice"}
];
const messageReadDates = new WeakMap();
messageReadDates.set(messages[0], new Date());
messageReadDates.set(messages[1], new Date());
console.log(messageReadDates.get(messages[0]));
console.log(messageReadDates.get(messages[1]));

+ Recent posts