In the Restify framework code I found this function:
function queryParser(options) { function parseQueryString(req, res, next) { // Some code goes there return (next()); } return (parseQueryString); }
Why would the author write return (next()); and return (parseQueryString);? Does it need parentheses there and if so, why?
return (next());
return (parseQueryString);
It doesn't need to be that way, but it's valid JavaScript code. Actually it's quite uncommon to see such syntax. I guess it's a personal preference of the author.
1.4m articles
1.4m replys
5 comments
57.0k users