Answers for "what is the meanof using next in nodejs"

1

what is the meanof using next in nodejs

/*
Some people always write return next() is to ensure that the execution stops after triggering the callback.

If you don't do it, you risk triggering the callback a second time later, which usually has devastating results. 
*/

app.get('/users/:id?', function(req, res, next){
    var id = req.params.id;

    if(!id)
        return next();

    // do something
});
Posted by: Guest on June-16-2020

Code answers related to "what is the meanof using next in nodejs"

Code answers related to "Javascript"

Browse Popular Code Answers by Language