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.
2.1m questions
2.1m answers
60 comments
56.9k users