Edit in JSFiddle

var $result = $('#result');
// Real world usage of bitwise operators

var a = 0, b = 1;
log('a & b', function() { return a & b }); // Both
log('a | b', function() { return a | b }); // Either
log('a ^ b', function() { return a ^ b }); // Exclusive or, either not both
log('~b',    function() { return ~b });    // Invert
log('a << b',function() { return a << b }); // Shift a in binary b left,
                                     // shifting in zeros on right
log('a >> b', function() { return a >> b }); // Shift a in binary b right,
                                      // discarding shifted bits
log('a >>> b', function() { return a >>> b }); // Shift a in binary b right,
                                        // discarding shifted bits,
                                        // filling in zeros from the left







function log( test, fn ) {
    $result.append('<tr><td>' + test + ': </td><td>' + fn() + '</td></tr>');
}
<table id="result"></table>
table { width: 200px; }
td { width: 50%; }
td:nth-child(2) { color: blue; }