title: Global Variables alternative
body: <p>I want to create an array that is accessible to all the .js files.  This array must also be updateable, and the updated changes must be reflected in all the other files using that array.</p>
  
  <p>I have read that using a GLOBAL variable is not a good method, but what is the alternative?</p>
  
  <pre><code>//file 1 which contains my global variable
  var mySharedArray = ['helo']; 
  module.exports = {
  mySharedArray: mySharedArray,
  get: function(){
      console.log(mySharedArray);
  } 
  }    
  
  //file 2 where i am pushing new-data 
  router.get('/workerequestest',function(req,res){
  queue.push("moreData");
  require('../config/globalQueue').get();
  require('../config/startWorkerQueue');
  res.send(200,'message recieved');
  });
  
  //file 3 where i am checking the updated values
  var interval = setInterval(function() {
  var Queue = require('../config/globalQueue').mySharedArray;
  require('../config/globalQueue').get();
  }, 10000,'hello' ,'checking for New processes');
  </code></pre>