0

I am new to .js and want to change this arrow function to normal function, for personal interest

module.exports.endpoint = fn =>
(req, res) => {
    Promise.resolve(fn(req, res))
        .catch((err) => {
            this.jsonOutHandler(err, null, res);
        });
};

How to achieve it?

Hrant Nurijanyan
  • 789
  • 2
  • 9
  • 26

0 Answers0