((45%2)==0) >45%2 =1 > (1==0) > false Therefore, var str=((45%2)==0)?"hello":"bye"; > str = false ?"hello":"bye"; > str="bye"