Monday 24 August 2020

Do parameters in function affect performance?

As per my code I have a base file. for exampleconst module = require(./apps/module); module.get(request, response, variable); In apps/module.js I use the same function multiple times. Should I use doThing1() or doThing2()? Both do the same thing but doThing2() has fewer paramaters. Does passing so many variables affect anything?function doThing1(request, response, variable, variable2){' blah blah blah...; }; function get(request, response, variable){ function doThing2(variable2){ blah blah blah...; }; if(){ doThing1(request, response, variable, 'data'); doThing2('data'); }else if(){ doThing1(request, response, variable, 'data'); doThing2('data'); }; };

Submitted August 24, 2020 at 07:47PM by omato2468

No comments:

Post a Comment