The code you present is a ternary operator which you correctly changed to a if/else
the "^" in this case is a "bitwise XOR" (A bit of home work for you).
So depending on what the "X" value is in relation to "50" the result will a true of false
drop this into a web page and play..
bw = '';
bw = 3^4?'yes':'no';
try 3^3 as well