Wednesday, 26 April 2017

What is the return type of a router function?

If I want to avoid lots of else blocks and deep indentations, what should be the return type if I want to exit a router function explictly?

app.get("/xx", function(req, res) {
   if (c1) {
      res.render("c1");
      return ??;
   }
   if (c2) {
      res.render("c2");
      return ??;
   }
   res.render("default");
})



via Old Geezer

No comments:

Post a Comment