By Arkadiusz Włodarczyk

var   x  =  5;
var   isEven  =  (x % 2 === 0)  ?  true  :  false;
alert  (isEven)

or

var x = 5;
alert ((x % 2 === 0) ? true : false);

you could substitute boolean true  false with string messages

O’REILLY – JavaScript from Beginner to Expert