turn ^= 1

by DoubleYo

HTML

<button>^= 1</button>
<p id="debug"></p>

JavaScript

var turn = 0,
    debug = $("#debug");
debug.append(turn);
$("button").click(function() {
    turn ^= 1;
    debug.append(","+turn);
});