discord.js/node : filter().map() best method I'm learning javascript with discord.js and node and I'm always looking for the "best" code.

Is this the "best code" for my map() ? ([role] required, (role) optional)

// Get [role] (@role) args
let roles = msg.mentions.roles.filter(role =&gt; (args[2] === `&lt;@&amp;${role.id}&gt;` || args[3] === `&lt;@&amp;${role.id}&gt;`)).map(role =&gt; {
  nbArgs++;
  return role.id;
});

// Get text
let txtContent = msg.content.split(/ +/g).splice(nbArgs).join(' ');
Maybe this is better :

let roles = msg.mentions.roles.filter(role =&gt; (args[2] === role.toString() || args[3] === role.toString())).map(role =&gt; role.id);


And use roles.length instead of nbArgs++ :

// Get text
let txtContent = msg.content.split(/ +/g).splice(roles.length + nbArgs).join(' ');