Whenever necessary, I also employ currying for my functions so that I wouldn't have to insert the same arguments over and over again. I'm pretty sure it's a "micro-optimization", but it does save me from the verbosity.
functionsomeHeavyComputation(n){letsum=0;for(leti=0;i<n;++I)sum+=i;returnfunction(){// Do something with `sum`...}}// Cache the computationconstgetBigNumber=someHeavyComputation(1000);console.log(getBigNumber());
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Whenever necessary, I also employ currying for my functions so that I wouldn't have to insert the same arguments over and over again. I'm pretty sure it's a "micro-optimization", but it does save me from the verbosity.