Modify a Javascript Function
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;
},
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;
},