var a = 0; var b = 1; var c = 2; var x = true ? a : b; var y = false ? c : b; console.log( x + y );