vendredi 15 juin 2018

How to use an if with 2 conditions in Reactjs

In reactjs, I can't use if with 2 conditions like Java because the && sign is used for an other conditions.

I try this:

if (this.state.actions[0]==="edit" && this.state.actions[1]===2) {
    /*result*/
}

So, it is possible to use an if with 2 conditions ? Thanks for help.

Aucun commentaire:

Enregistrer un commentaire