Ticket #653 (closed enhancement: wontfix)
Add custom xor implementation
| Reported by: | zilenCe | Owned by: | |
|---|---|---|---|
| Type: | enhancement | Priority: | trivial |
| Milestone: | Mootools version 1.2 | Component: | Core |
| Keywords: | Cc: |
Description
Since JavaScript? lacks the xor operator it would be handy to have this function as a utility Function:
function $xor(a, b){
return (a || b) && !(a && b);
}
Returns true if a OR b is true but not if both are
usage:
$xor(true, false) //returns true $xor(true, true) //returns false $xor(false, false) //returns false
Change History
Note: See
TracTickets for help on using
tickets.