How would I get a positive test for bar and foo's equality?
foo = function() {
a = 1;
};
bar = function() {
a = 1;
};
if (foo === bar) alert('baz');
if (foo == bar) alert('qux');
Both the above conditionals are false.
Updated - As requested the reason I need to test for function equality
I am building a Publish/Subscribe framework and need to pass the callback inorder to unsubscribe to a topic.
Please see the fiddle: http://jsfiddle.net/jamiefearon/hecMS/47/