
Comparison Operators & If Else - Beau teaches JavaScript
video description
Date: 2022-03-14
Related videos
Comments and reviews: 3
Abhinav
You mentioned whenever we have an expression with an assignment to a number, inside the if condition, it is always going to evaluate to TRUE. but that is only if the assignment is for a non-zero number
for ex:
if (age = 1) will be, true
if (age = 0) will be, false
if (age = 0.0) will be, false
reply
You mentioned whenever we have an expression with an assignment to a number, inside the if condition, it is always going to evaluate to TRUE. but that is only if the assignment is for a non-zero number
for ex:
if (age = 1) will be, true
if (age = 0) will be, false
if (age = 0.0) will be, false
reply
pradeep
how to solve a multiple if statement with in a single function
example program is
function testLessThan(val) -
if (val < ) -
return -Under 25-;
-
else if (val < ) -
return -Under 55-;
-
return -55 or Over-;
-
// Change this value to test
testLessThan(10);
reply
how to solve a multiple if statement with in a single function
example program is
function testLessThan(val) -
if (val < ) -
return -Under 25-;
-
else if (val < ) -
return -Under 55-;
-
return -55 or Over-;
-
// Change this value to test
testLessThan(10);
reply
Paul
With the if...else statements failing on baby, another way other than swapping could be:
if else (age > 2 && age < 18)
console.log(-You are a child-);
reply
With the if...else statements failing on baby, another way other than swapping could be:
if else (age > 2 && age < 18)
console.log(-You are a child-);
reply
Add a review, comment
Other channel videos















