function test() {
alert(1);
return "hello";
}
Function.prototype.before = function (func) {
var __bself = this;
return function () {
if (func.apply(this, arguments) == false)
return false;
return __bself.apply(__bself, arguments);
}
};
test.before(function (){
alert(2);
})();
What is the meaning of if (func.apply(this, arguments) == false)
?
I don't think the function will return false.