I'm just learning json. I'm trying to create an array of object Messages, The declaration does not give me a error, but when I try to access it using the following code
serverReply2.Mesages[0].Date
, i get an error:
Uncaught TypeError: Cannot read property '0' of undefined
code:
this.serverReply2 = {"Messages": [
{"Date": "1/1/1",
"Mwessage": "test messageA",
"Attachmentsd": ["link2","link2"]},
{"Date": "1/1/2",
"Mwessage": "test messageB",
"Attachmentsd": ["link2","link2"]},
{"Date": "1/1/3",
"Mwessage": "test messageC",
"Attachmentsd": ["link2","link2"]},
]
};
alert( serverReply2.Mesages[0].Date );