title: Using a variable to name another variable javascript
body: <p>In the process of making a discord bot using node.js and discord.js, I've come to a point where I want to create a new variable, in this case an object with one property (the string "server" and some string for a value.) To name said new variable, I want to use the server ID of the server I'm referring to here, which is stored in another variable. What is a way I can do this?</p>
  
  <p>So far I've tried 
  <code>eval("var " + serverID + " = {'server': 'test'}")</code>, which gave me a syntax error: invalid/unexpected token on the second plus sign (replacing the object with a string still gave me the same error). Everywhere I've looked hasn't been helpful in explaining what is wrong with the <code>eval</code> function, and I'm confused as to how I would do this another way.</p>
  
  <p>In case the first thing that came to your mind was restructuring how I'm working with variables and the types I'm using, whatever this outputs must let me add more information to this variable, which at least in my mind restricts me to using Objects and adding properties. I also store this variable to a JSON file later in the code which also restricts me to using either Arrays or Objects.</p>