how to typecast a method holder in Javascript, like Delegate

I started working with threads just to experiment, maybe use it for my pathing, and i was wondering how to typecast methods? also how would you do do a delegate in javascript? or some form of method hoding

I have this working, but want to make a static function I can call from anywhere to get a thread started, or something of the like.

#pragma strict
import System.Threading;
var myBool:boolean=true;
function Start(){
	var ts:ThreadStart=new ThreadStart(MyThreadRunner);
	var myThread:Thread=new Thread(ts);
	myThread.Start();
}
function MyThreadRunner(){
	while(myBool){
		Thread.Sleep(1000);
		Debug.Log("Still going!");
		myBool = !myBool;
	}
}

BTW: I can replace

var ts:ThreadStart=new ThreadStart(MyThreadRunner);

with

 var ts:ThreadStart=new ThreadStart(Answers.PrintWin);

to call a static function PrintWin on class Answers, but how would I typecast that?
how would i typecast a var to put in the new TreadStart situation like a delegate?
I know I’m repeating the question, just trying to get a clear response.

You can’t use delegates in js. Instead they have function types which are like implicit delegates:

var func : Function;
func = SomeFunction;

var func = function () {
        Debug.Log("Anonymous Function");
        } ;

 //callbacks are supported.
 var SomeOtherFunction (obj : Object, callback : function(Object) ) {
        callback(obj);
 }
var someOtherFunc : Function(Object);
someOtherFunc = SomeOtherFunction;

Function types are relatively type safe. They do have to match the signature if you pass them as a callback.