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 => (args[2] === `<@&${role.id}>` || args[3] === `<@&${role.id}>`)).map(role => {
nbArgs++;
return role.id;
});
// Get text
let txtContent = msg.content.split(/ +/g).splice(nbArgs).join(' ');