4
setup: function (baseUrl, devModeCheck) { 

where devModeCheck is a function that will be called.

Is there any commonly-used naming convention in javascript that makes this intention obvious?

devModeCheckFunc and fDevModeCheck both seem kind-of horrible.

1
  • if its a call back function then I generally use "cback". but most of all documentation will assist you in understanding your code at a later date or another developer having to read it. Always document Commented Apr 24, 2011 at 3:10

1 Answer 1

2

callback is a pretty common naming convention. For simpler higher order functions it holds well, but if you write more complicated code it may not be that simple (like if you have several callbacks).

As with naming anything in code, make the intent clear on what something is. callback may be too generic in some instances, or it may be too specific in others.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.