Can anyone tell me why this code will not delete messages from the messages property of this object?
var facebookProfile = {
name: "Bill Smith",
friends: 0,
messages: ["msg"],
postMessage: function(message) {
message = "hello";
facebookProfile.messages.push(message);
},
deleteMessage: function(index) {
index = 0;
facebookProfile.messages.splice(index);
},
addFriend: function() {
facebookProfile.friends = facebookProfile.friends + 1;
},
removeFriend: function() {
facebookProfile.friends = facebookProfile.friends - 1;
}
};