passing a function as a parameter to another function

is it possible to do something along the lines of this (in Javascript)

function foo() {
   print("hello Unity");
}

function boo(passedFunction) {
    yield new WaitForSeconds(2) //wait then
    //call passedFunction
}

boo(foo);

thanks in advance,

Chris

Yes, you can do that using the following syntax:

// define your inner function as a named variable
var foo = function() { print("hello Unity"); }

// define your outer function normally
function boo(passedFunction) {
  // call the passed function
  passedFunction();
}

// call the outer function using the named-variable-function
boo(foo);