You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// no odd numbers allowed!vareven=spec(function(candidate){return0===candidate%2;});
Negate that guy and save him for later.
// negate even to get an odd futurevarodd=even.not();
Maybe get a little fancy with it.
// detest negativityvarpositive=spec(function(candidate){returncandidate>0;});// evenly positivevarevenAndPositive=even.and(positive);// odd or negativevaroddOrPositive=odd.or(function(candidate){returncandidate<0;});
Now with more short circuiting.
// number five is alivevarshortCircuit=even.or(function(candidate){// this will never run...need proof?console.log("No disassemble Number Five");return(null===candidate||"undefined"===typeofcandidate);});