xxxxxxxxxx
// using Short-circuit Evaluation Shorthand.
// a !== 2 : else condition
// 'yes' : result of if condition
var a = 46,
var b = a !== 46 || 'yes';
xxxxxxxxxx
var time = Date().getHours(); // or something
var clockTime = time > 12 ? 'PM' : 'AM' ;
xxxxxxxxxx
var res = 1 == 1 ? 'true' : 'false' // res = true
var res = 1 == 2 ? 'true' : 'false' // res = false