Accessing C# Delegate from Javascript

What is the JavaScript equivalent of the C#… playButton.onTouchUpInside += sender => Debug.Log( "button touched" ); ?

I’m trying to use @prime_31’s UIToolkit, but all the examples that use it use it with C# - which I don’t know and don’t currently have time to learn.

You cannot declare delegates in js, but you can use function types to add methods to delegates created in a C# class.

  someDelegate += MyMethod;
  someDelegate += function() {
            Debug.Log("Anonymous Method"); 
            };
  function MyMethod() {
  }