Can anyone explain why these two strings are generating different outputs….
var x=true ;
var str1="Hello "+ x?"Man":"World" ;
var str2="Hello "+(x?"Man":"World") ;
document.write(str1+"<br>"+str2) ;
Str1 prints “Man” and Str2 prints “Hello Man”