let messagesArr = [
{ from: "John", text: "Hello" },
{ from: "John", text: "How goes?" },
{ from: "Alice", text: "See you soon" }
];
alert(messagesArr[2].text);
let quantity = messagesArr.length;
var name, text;
for (var index = -1; index <= quantity; index++) {
name = messagesArr[index].from; // 13 строка
text = messagesArr[index].text;
addMes();
}