function properties in Unity Javascript

Hi, I wanted to explore what can be done with functions in Unity3D javascript. In regular javascript every function is a Function object. What is a function in Unity3D javascript? If I do a Debug.Log(this.Update) this is what I get CompilerGenerated.MyClass_OnMouseDown$callable0$33_38. First thing, why is it printing OnMouseDown instead of Update and, more important, what kind of object is Update and OnMouseDown? Please help! =<

They’re both function types.

var myFunc : function = Update;

then you can pass them to a function:

  function SomeAction ( target : Object , callback : function(Object) ) {
      callback(target);
  }

Are you want to show what is Update?

If that, you should do this

Debug.Log(Function) //<-- It should make Function.

Unity Function can use in a var in javascript.

var callFunction : Function;

function Start ()
{
    callFunction = MainMenu;
}

function OnGUI ()
{
    callFunction();
}

function MainMenu ()
{
    // Do something about main menu
    if (GUILayout.Button("Setting"))
    {
        callFunction = Setting;
    }
}

function Setting ()
{
   // Do something about setting
    if (GUILayout.Button("Main Menu"))
    {
        callFunction = MainMenu;
    }
}