Its being annoying
Following code :
var arrays = [1,2,3]; alert(\'Array has \' + (arrays.length > 0) ? \'multiple\':\'single\' +
Your first example is parsed this way
alert(('Array has ' + (arrays.length > 0)) ? 'multiple':('single' + ' value'));
given the operator precedence of + is much higher than that of ?:.
+
?: