Difference between req.param = function(){} and req.param = function param() {}

35 views Asked by At

I was looking into express.js repository and noticed that, for example, authors created req object and his methods by using this code:

req.param = function param(name, defaultValue) {}...

but in some others methods they have this code:

req.accepts = function(){}...

So, what's the difference between those two approaches ? Couldn't they write just:

req.param = function(name, defaultValue){}...

Is there a difference in functionality between those two approaches ?

0

There are 0 answers