-2

I am new to JavaScript, and I am struggling with how to change an arrow function with non-arrow function... Please help, and thank you very much in advance!

this.middleware(req,res,()=>{
    this.processRoutes(req,res);
});
Nathan Bell
  • 137
  • 12

1 Answers1

-1

This is how you can do it.

this.middleware = function(req,res) {
  this.processRoutes(req,res);
};

However you should use arrow function unless you have any specific reason for not to use it.

Jeet
  • 5,149
  • 7
  • 41
  • 71