title: Constantly getting "x is not a function" error in node.js
body: <p>I'm trying to call a method inside another method but I get error "x is not a function".
  The methods are in very same class.
  I'm new in node so I don't get its errors at all. My code is :</p>
  
  <p>file app.js :</p>
  
  <pre class="lang-js prettyprint-override"><code>const express = require("express");
  const app = express();
  const pkg = require("./app/b.js");
  
  const port = 3001;
  
  pkg("Hi");
  
  app.listen(port, () =&gt; console.log("app is running on port " + port));
  </code></pre>
  
  <p>and my b.js file is like: </p>
  
  <pre class="lang-js prettyprint-override"><code>class BFile{
    y(str){
      // some irrelative codes
      x(str)
    }
  
    x(arg){
      // some code
    }
  }
  
  const obj = new BFile()
  module.exports = obj.y
  </code></pre>
  
  <p>note: I tried to use "this" before calling x method ( like: this.x(str); ) but "this" is undefined</p>