vendredi 3 juillet 2015

Javascript ternary operator result always the same

The code below always responds with "hi". Even if i set the campaign1 variable to 0. Can anyone advise if I am writing this out incorrectly?

campaign1 = 2;

campaign_string = (typeof campaign1 > 1 ? "hello" : "hi" );

Kind regards,

Aucun commentaire:

Enregistrer un commentaire