When to use next() and return next() in Node.js
As @Laurent Perrin’s answer: If you don’t do it, you risk triggering the callback a second time later, which usually has devastating results I give an example here if you write middleware like this: app.use((req, res, next) => { console.log(‘This is a middleware’) next() console.log(‘This is first-half middleware’) }) app.use((req, res, next) => { console.log(‘This … Read more