title: How can I convert a string to a variable name in Node.js?
body: <pre><code>//Admin.js
  
  var insertAdminFeed = function(s, id, timestamp){
      var admin_att_new_key = '12345';
      var admin_att_new_key2 = 'abc';
      var admin_att_new_key3 = 'zyzyz';
  
      var s = 'admin_att_new_key';
      console.log(global[s]); //should print '12345'
  };
  exports.insertAdminFeed = insertAdminFeed;
  </code></pre>
  
  <p>I want to convert a string to a variable in node.js (I have many keys, and I don't want to write if/else statements for all of them) How can I do that?</p>