title: Discord.js | How do I make a command that adds to an array variable?
body: <p>so I tried to make a command that adds to an array (and also prints it / say it). However, I don't know how to do that.
  Here's my code:</p>
  <pre class="lang-js prettyprint-override"><code>const ALLANG = []
  
  let messageArray = message.content.split(&quot; &quot;);
  let cmd = messageArray[0];
  let args = message.content.substring(message.content.indexOf(' ')+1);
  
  if(cmd === (prefix + &quot;translate&quot;)) {
          message.channel.send(`All the available language: ${ALLANG} /* English, Spanish*/`)
        }
  
  
  if(cmd === (prefix + &quot;translateToENG&quot;) {
  // Here i want to add &quot;English&quot; to the variable
  
  translate(args, {to : 'en'}).then(englishTranslated =&gt; {
          message.channel.send(englishTranslated)
      }).catch(err =&gt; {
          message.channel.send('An error has occupied')
          console.log(err)
      })
    
  }
  
  
  if(cmd === (prefix + &quot;translateToSpanish&quot;)) {
         // Here add &quot;Spanish&quot; to variable too
  
  
      translate(args, {to : 'es'}).then(spanishTranslated =&gt; {
          message.channel.send(spanishTranslated)
      }).catch(err =&gt; {
          message.channel.send('An error has occupied')
          console.log(err)
      })
  }
  </code></pre>
  <p>Sorry for my bad English, but Thank you if you helped me.</p>