mardi 23 mai 2017

If-causes with boolean in javascript (Beginners)

Is there a possibility to write this "If" more efficient?

if((text.val(“Hello“) == false)&& (text.val(“This“) == true)&&(text.val(“Is“) == false)&&(text).val(“Me“) == false))
{     
  text = "This"
}

This “if“ should check, whether a value is set true or not. It should display only the “true“ one. If I make it in this way, I have to make a lot of If’s in order to have all possibilities. Is there a way to make it more efficient and better? In database all values are boolean.

Aucun commentaire:

Enregistrer un commentaire