Skip to main content

All Questions

10 votes
5 answers
8k views

How to name a function that returns a function?

Let's say, for example, that I have a function makeFoo that makes another function foo: function makeFoo(string) { return () => string } const foo = makeFoo('bar'); I know that makeFoo is a ...
Splox's user avatar
  • 209
4 votes
1 answer
3k views

Naming conventions for pure functions

Are there 'conventions' / best practices on naming pure functions? For example: adding numbers: add or sum? calculating the square root: calcSqrt or sqrt? reversing a list: reverse or reversed? ...
Willem-Aart's user avatar
6 votes
3 answers
2k views

What is the name for a NON-self-calling function?

I have a collection of normal functions and self-calling functions within a javascript file. In my comments i want to say something along the lines of "This script can contain both self-calling and ...
Alan Lapington's user avatar