title: nodejs callback issue.. not a function
body: <p>I am currently learning NodeJS and working on a mini app, trying to understand callback. However I keep getting the error:</p>
  
  <pre><code>  callback(undefined,price);
        ^TypeError: callback is not a function
  </code></pre>
  
  <p>This is my code : </p>
  
  <pre><code>var getCoin = (coin, callback) =&gt; {
  
    request({url:`https://https://rest.coinapi.io/${coin}&amp;ssr=USD`,
  
    json: true
    }, (error, response, body) =&gt; {
  
  
      if(error){
        callback("error");
  
      }
      else if (response.statusCode == 200) {
        let price = body.RAW[coin].USD.PRICE;
        callback(undefined,price);
  
      }
    })
  };
  
  app.get('/', (req, res) =&gt; {
    coin.getCoin('BTC', ()=&gt; {
      res.render('index.hbs', {
        coin:'Bitcoin',
        price: coin.getCoin('BTC')
  
      });
    });
  });
  </code></pre>