I'm trying to make multiexpression for ternary operator in Javascript like this :
condition ?
exp1 ; ... ; expN
:
alternative1 ; ... ; alternativeN
Here my code :
validateEmail && validatePassword ?
this.setState({validateForm: true})
this.setState({nameSubmit:"onSubmit"})
: null
My console returns me an error :
Declaration or statement expected
The javascript documentation talks about :
Syntax :
condition ? expr1 : expr2
But maybe someone has achieved the multi expression ternary operator ?
Thanks