If you need to check to see if two functions are the same instance, you can just check the variables for equality:
var f = new function() {
alert("hello world");
};
var f1 = new f();
var f2 = new f();
var boolTest = (f1 == f2);
However, if you need to check to see if the bodies of those functions are equal (or both contain some text, etc -- essentially, just working with the actual language of the function), you can just cast as string to get the text of the function, then check for equivalency:
function fnsAreEqual(f1, f2){
return String(f1) === String(f2);
}
var boolTest2 = fnsAreEqual(
function(){ alert("sameFn"); },
function(){ alert("sameFn"); }
);
updated: fixed JavaScript formatting