Assign other value to a variable from two possible values | Function to alternate the values ; Main function
function alternate ( a , b , x ) { return x = a ^ b ^ x ; } var a = - 10 ; var b = 15 ; var x = a ; document . write ( " " + x ) ; x = alternate ( a , b , x ) ; document . write ( " " ) ; document . write ( " " + x ) ;