title: I am getting an error when creating functions in a class
body: <p>I am trying to create a class that will interact with a postgres database by use of classes, but keep getting an error when creating functions in classes</p>
  
  <p>I have tried using constructor functions with prototypes but still get an error</p>
  
  <pre><code>/* eslint linebreak-style: ["error", "windows"] */
  // eslint-disable-next-line no-unused-vars
  const pool = require('../config/config.js');
  // user constructor
  class User {
    constructor(user) {
      this.username = user.username;
      this.email = user.email;
      this.password = user.password;
      this.role = user.role;
    }
    // save new user in databes
    function createUser() {
  
    }
  
    }
  
  module.exports = User;
  
  
  
  
  function createUser(params) {
             ^^^^^^^^^^
  
  SyntaxError: Unexpected identifier
      at new Script (vm.js:80:7)
      at createScript (vm.js:274:10)
      at Object.runInThisContext (vm.js:326:10)
      at Module._compile (internal/modules/cjs/loader.js:664:28)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
      at Module.load (internal/modules/cjs/loader.js:600:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
      at Function.Module._load (internal/modules/cjs/loader.js:531:3)
      at Module.require (internal/modules/cjs/loader.js:637:17)
      at require (internal/modules/cjs/helpers.js:22:18)
  </code></pre>
  
  <p>This is the error that am getting</p>