+ 2
Can i add more than one condition ??
In if statement how can i add multiple conditions at the same time
5 Réponses
+ 6
You Can practise as follows:
Suppose you're going to write true, if the variable x is greater than 5 and the variable y is equal to 10; To do this you can save the conditions in separate variables:
var a = x > 5;
var b = y == 10;
and to execute a code if its true:
if(a && b) {
your code
}
+ 4
Using logic:
if (x && y) {} (x and y)
or
if (x || y) {} (x or y)
Among others!
+ 4
Abdalrhman ⚡ It Can and cannot be, depends on how you use it
+ 2
Nathan Lewis thanks
+ 2
const InvBoy = me;
But in this situation a & b is not variables .. am i right ?