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
@motthebug7 жыл бұрын
Good point (tho' the point is that it means something different from asking if it's equal...)
@eeekkk342357 жыл бұрын
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");
@pilyglot30377 жыл бұрын
The alligator always eats the bigger number... it's greedy that way. (how I learned < and >)
@farkhadmusazov72262 жыл бұрын
that's so cute and handy
@Allaboutdatps34 жыл бұрын
Makes perfect sense, thanks.
@xortegaccaedu6 жыл бұрын
Please slowwwwww down. Love what you are doing.
@pradeepchand81786 жыл бұрын
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);
@hashtagtrends98864 жыл бұрын
Thank You @t !
@thomasgeorge45786 жыл бұрын
this so similar to python!
@farkhadmusazov72262 жыл бұрын
thank u
@Fichleai7 жыл бұрын
What about === and !== ?
@BeauCarnes7 жыл бұрын
Albin Metthey I have a "=== vs ==" video coming out soon but it may have been good to include those in this video.
@sasha_prisyazhnyy6 жыл бұрын
Mr. Carnes explicitly says in the very end of the video that this information is covered in later videos. I think the aim of the course is to give the information by small comprehensible bits to get the basic idea of the concepts.