mardi 23 janvier 2018

is it possible to handle 2 variable to changing if/else condition is true on ES6?

Let say I have a code like this

var a,b;
b=1;
var c = b > 0 ? a=1 /*and c=2*/ : a=0 /*and c=1*/;
console.log(a + c);

there's a way to make c=2 and a=1 with above code?

Aucun commentaire:

Enregistrer un commentaire