title: Unable to call a local function on ExpressJS
body: <p>I'm learning to develop a Rest API using NodeJs with Express JS. I build a controller to do my stuff inside it. I want to call a local function inside the controller but it is not working. I always get <strong>not defined</strong> error.</p>
  <p>Hear is my Controller,</p>
  <pre><code>const db = require('../config/db');
  
  class TransactionController {
  
      constructor(){
      }
      
      generateCustomerTransaction(req, res) {
  
          const program_id = req.params.program_id;
  
          const customerList = getCustomerList(program_id); //error here
  
          //Do some business logics
  
          return res.json(result);
      };
  
  
      getCustomerList(program_id) {
         //Do some query to get a list of result
         return results;
      }
  }
  
  module.exports = SeatExcelController;
  </code></pre>
  <p>Everything seems simple like others languages but I get</p>
  <p><strong>ReferenceError: getCustomerList is not defined</strong></p>
  <p>I have no idea how to simply call a local function.</p>
  <p>Please help. Thanks a lot.</p>