These are the first few lines in the MicrosoftAjax.debug.js file.
What are they doing with the syntax? Specifically line 3.
Function.__typeName = 'Function';
Function.__class = true;
Function.createCallback = function Function$createCallback(method, context) {
This is ordinary code which happens to have a
$character in a function name.The expression
function Function$createCallback(method, context) { ... }is a named function expression; it evaluates to a function namedFunction$createCallback.Unlike many languages, the
$character is perfectly legal in a Javascript identifier (see jQuery), so this is a normal function with a somewhat unusual name.The code assigns that function to create a
createCallbackproperty on theFunctionobject.(The property happens to be a function; Javascript functions are no different from variables)