Modify a Javascript Function

Job ID: 33909503

Budget: $10 – $30 USD

I have a javascript function for an open-source project that I want to contribute too, that I need modified.

I am not exactly sure what this does, but I want to have it evaluate the text for a pipe delimeter, and if exists, add the text to the msgs array.

popupMessages: function () {
var msgs = [];

for (var i = 0; i < this.state.messages.length; i++) {
var text = this.state.messages[i].text;
if (!/^#/.test(text)) msgs.push(text);
}

this.showPopup = msgs.length != 0;

return msgs;
},
Related categories: PHP JavaScript CSS HTML jQuery / Prototype