1👍
✅
This will do exactly what you want it to do, but you should try to understand and not just blind copy it:
messages = messages.map(
function(message){
return message.message;
}
);
Read about Array.prototype.map()
Source:stackexchange.com