title: node js how to auto call of any getting function in node js
body: <p>On the time of page loaded get_switch() function which globally created  on app.js page will be call then return a method. i want to execute these return methods.</p>
  
  <p>demo.js</p>
  
  <pre><code>const return_functions = get_switch('BTC');
  
  function get_btc()
  {
      console.log('btc');
  }
  
  
  function get_bch()
  {
      console.log('bch');
  
  }
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code> global.get_switch=function(coin_name){
  
   switch(coin_name){
  
    case 'BTC':
    return 'get_btc()';
    break;
  
  
    case 'BCH':
    return 'get_bth()';
    break;
  
    default:
    console.log('default');
    }
  
   }
  </code></pre>
  
  <p>As shown in example above i have passed BTC in get_switch. and that function return us get_btc() function. so i want to call get_btc function on same time.</p>
  
  <p>If this is not possible in this way so please guide me with your idea and suggest me how can i do this.</p>