Gabriel M Fernandes Gabriel M Fernandes - 2 years ago 85
Node.js Question

Node.js map returning result between quotes and brackets in Slack window

I am building a Slack app that has a slash command for displaying data from the database using

module like this:

select: () =>, null, row => {
return 'User ' + row.username + ' is ' + row.status;

Like this, an array of rows is returned, but the result is always like:

["User username1 is status1", "User username2 is status2", ...]

I need it to be displayed in a list, without these quotes and brackets.

User username1 is status1
User username2 is status2

I've tried to
using regex, but it doesn't work.

Answer Source

If your intent is simply to display the resulting strings:

var os = require('os');, null, row => {
    return 'User ' + row.username + ' is ' + row.status;
    .then(data=> {
    }); resolves with a new array of returned values, the same as your regular

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download