setup: function (baseUrl, d开发者_C百科evModeCheck) {
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.
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.
精彩评论