title: node - this.func() is not a function
body: <pre><code>function Job(name, cronString, task) {
      "use strict";
  
      this.name = name;
      this.cronString = cronString;
      this.isReady = false;
      this.task = task;
  }
  
  Job.prototype.performTask = (db, winston) =&gt; {
       "use strict";
      const Promise = require("bluebird");
      let that = this;
      return new Promise((resolve, reject) =&gt; {
          let output = "";
          let success = true;
  
          try {
              output = that.task();
          }
          catch(error) {
              success = false;
              reject(error);
          }
  
          if(success) {
              resolve(output);
          }
      });
  };
  
  module.exports = Job;
  </code></pre>
  
  <p>Javascript newbie here. When I make a <code>Job</code> object and call the <code>performTask</code> method, I get "that.task is not a function". Shouldn't <code>this</code> at the very beginning of the <code>performTask</code> method refer to <code>Job</code>?
  What is the mistake I'm making?
  Also, is there a better way of doing what I'm trying to do here?</p>