[ad_1]
Yes, the ternary operator also exists in Javascript.
The code you posted
for (i=0; i< (x == 0 && y < 0 ? x-y : x+y); i++)
will work, verbatim.
1
[ad_2]
solved Is there an equivalent of ? : operator of C# in Javascript/Jquery? [closed]
[ad_1]
Yes, the ternary operator also exists in Javascript.
The code you posted
for (i=0; i< (x == 0 && y < 0 ? x-y : x+y); i++)
will work, verbatim.
1
[ad_2]
solved Is there an equivalent of ? : operator of C# in Javascript/Jquery? [closed]