In C# I can do the following:
public delegate void Callback();
void f1() {
}
void f2() {
}
Callback c = f1;
c+=f2;
And then when I call c()
I will f1
and f2
get called.
How can I achieve the same result in javascript?
I mean I can do in javascript the following:
var c;
function f1() {
}
function f2() {
}
c = f1;
But I can not add f2
to c
.